Question:
How do i tweak the output of this code:
~let say i type in 2012 and the output should be February 29, 2014 Wednesday is a leap year (same thing with the other leap year)
~ i type in 2013 and the output should be 2013 is not a leap year.
Thanks in advance.
----------------------------------------current code---------------------------
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;
}