if you take eg as input data 1600 then this is clearly a leap year
now think about what will be the result of your first condition
if (year / 400 == 0)
that's 1600 / 400 == 0 or 4 == 0 -> and that's of course false ==> no leap year
you probably wanted to try the modulo operator...
+1
This website uses cookies to provide you with personalized service. By using this website, you agree to our use of cookies. If you require more details, please read our Terms and Policy.