DEV Community

Discussion on: Important C Programs

Collapse
 
yuryyury profile image
YuryYury

It looks to me like there is a mistake in the Leap Year Program:

if ((year % 400 == 0) || (year % 4 == 0 && year % 100 == 0))
Enter fullscreen mode Exit fullscreen mode

should probably read

if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))
Enter fullscreen mode Exit fullscreen mode