why does this program say 1700 is a leap year?
Code:
#include <stdio.h>
main()
{
int year;
printf("Enter a year\n");
scanf("%d", &year);
getchar();
if (year%400==0)
printf("%d = leap year", year);
else if((year%100==0)&&(year%400==0))
printf("%d = leap year", year);
else if(year%4==0)
printf("%d = leap year", year);
else
printf("%d = not a leap year", year);
getchar();
}
ok, so i've searched through prior threads about this topic, and i still have not been able to figure out an answer. thanks in advance for any help.