Friday 24 June 2016

C programme to print the calendar of given Month



C programme to print the calendar of given Month

Source Code:
#include<stdio.h>
#include<conio.h> 
int main() 
{  
int day,i=1,c=0,j;  
printf("\nEnter the starting day of the month(1-Monday)"); 
 
scanf("%d",&day);  
printf("\n\nSun\tMon\tTue\tWed\tThur\tFri\tSat\n");  
printf("\n===========================================================\n");  
printf("\n");   
if(day==1)   
{    
c=1;   
}   
else if (day == 2)   
{    
c=2;    
printf("\t");   
}   
else if (day == 3)   
{    
c=3;    
printf("\t\t");   
}   
else if (day == 4)   
{    
c=4;    
printf("\t\t\t");   
}   
else if (day == 5)   
{    
c=5;    
printf("\t\t\t\t");   
}   
else if (day == 6)   
{    
c=6;    
printf("\t\t\t\t\t");   
}   
else if(day==7)   
{    
c=7;    
printf("\t\t\t\t\t\t");   
}  
while(i<=30)  
{    
printf("%d\t",i);    
i++; 

if(c%7==0)    
{     
printf("\n");    
}    
c++;  
} 

}

0 comments:

Post a Comment

Have A Wonderful Day !

--------------------------------------------------------------------

Word Of The Day | Learn And Use A New Word Everyday!

--------------------------------------------------------------------

"Insidious"

Working or spreading in a hidden and usually injurious way

"glaucoma is an insidious disease"

Copyright © 2016 Engineers Burger - All Rights Reserved. Digital Craftmanship - Nikhil Jha and Jay Akbari.
MyBloggerLab.com