+ 1
Leap year logic doubt
Leap year if divisible by 4 ryt , then why do we check for 400 and 100. If it is divisible by 4 then ofcourse it is divisible by 400 also so no need of 400 and All the years multiple of 4 i.e 400 , 800 etc are checked , then why do we need to check for 100 also in leap year So Just by checking if divisible by 4 then leap year else not Is this right??
2 Respostas
+ 5
Not every year divisible by 4 is a leap year. Those years ending in "00" are only a leap year if the numbers before them are a multiple of 4.
So 1600 and 2000 are leap years, 1700, 1800 and 1900 are not.
+ 2
Thankyou Russ and @Kiibo Ghayal
@Russ your example of the number 1700 cleared my doubt
Here the condition fails for 4.
Thanks.
Saved my time.