VB icon

DOS - Turbo C Calendar

Submitted on: 1/8/2015 2:09:00 PM
By: technicalganesh (from psc cd)  
Level: Beginner
User Rating: By 2 Users
Compatibility: C, C++ (general), Borland C++, UNIX C++
Views: 2771
     Include Display a Calendar in DOS based C Programs, Learn How to calculate day, month year
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
// Name: DOS- Turbo C Calendar
// Description:Include Display a Calendar in DOS based C Programs, Learn How to calculate day, month year
// By: technicalganesh (from psc cd)
// Inputs:Month and Year as integers
// Returns:Calendar Displayed
// Assumes:Modify If applied in Unix-C
// Side Effects:-

void main()
	int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int m,d,y,fh,h,f,i,jd=0,dow,j;
	printf("Enter Month : ");
	printf("Enter the Year : ");
	/* To adjust 29 days for the Leap Year */
	if (y%4==0) month[2]=29;
	for(i=1;i< m; i++)
	printf(" Sat Sun Mon Tue Wed Thu Fri\n");
	for(j=0;j< dow;j++) printf("%4s");
	for(i=1;i< month[m]; i++)
		if(j==0) printf("\n");

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

 There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)

To post feedback, first please login.