Saturday, 11 April 2015

Display the day of Gregorian calendar.

According to the Gregorian calendar, it was Monday on the date 01/01/1900. If any year is input through the keyboard. Write a program to find out what is the day on 1st January of this year.


Code

void main(){
char* vDay[] ={"Friday","Saturdy","Sunday","Monday","Tuesday","Wednesday","Thursday"};
int vYear;
clrscr();

printf("Enter a Year Format YYYY: ");
scanf("%d",&vYear);
printf("%s On 01.01.%d",vDay[vYear%7],vYear);

getch();
}



Output




No comments:

Post a Comment