Kevin Chu (kevin@portal.ca)
Sun, 17 Jan 1999 06:14:43 -0800
There is a blurb about leap years in K&R II p41.
"A year is a leap year if it is divisible by 4 but not by 100, except
that years divisible by 400 are leap years. Therefore
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
printf("%d is a leap year\n", year);
else
printf("%d is not a leap year\n", year);
[ end quote ]
Typos mine.
Kevin
-- Kevin Chu kevin@portal.ca http://members.tripod.com/~super_kevin/
This archive was generated by hypermail 2.0b3 on Sun 17 Jan 1999 - 06:31:50 PST