How do I tweak the output of this code:
Let's say when I type in 2012. The output should be February 29, 2012 Wednesday is a leap year (same thing with the other leap year)
If I type in 2013, the output should be 2013 is not a leap year.
Here's my current code:
include <stdio.h>
int main()
{
int year;
printf("Enter a year to check if it is a leap year\n");
scanf("%d", &year);
if ( year%400 == 0)
printf("%d is a leap year.\n", year);
else if ( year%100 == 0)
printf("%d is not a leap year.\n", year);
else if ( year%4 == 0 )
printf("%d is a leap year.\n", year);
else
printf("%d is not a leap year.\n", year);
return 0;
}
What should I to determine the day of week of February 29th in a leap year?