Posted by: lootekukur September 28, 2006
Login in to Rate this Post:
0
?
{
f (y%100==0)
{
if (y%400==0)
return true; -----------> means, if it is divisible by 100 AND 400, return true
else
return false; ------>if it is divisible ONLY by 100....return false..
}
else if (y%4==0)
return true;
return false;
}
--well , as per my reading, you should have following conditions
1) the year is divisible by 4 (NOT the sufficient condition, so you have to look into)
(a) is the year divisible by 4 and not by 100? if yes, it's a leap year else not
(b) is the year divisible by 4 and by 100? (NOT the sufficient condition, so you have to look into)
(i)is the year also divisible by 400 as well? if yes, it's a leap year, else not
obviously, it's not a leap yr if its not divisible by 4.
sajhauser is right and she provided the link as well. you should have gone through it :P
LooTe