+ 2
Why we take year %100 != 0 to find leap year ??
4 Respuestas
+ 3
Hi Nishant, I have a code named "Leap Year Test" in my profile which might help answer your question. Let me know what you think about it.
+ 3
Leap years are according to two rules.
(a) When the last two digits are 00:- If the last two digits are 00, then the year is leap year if the year is divisible by 400. For example:- The year 2000 is leap year but 2100 is not a leap year.
(b) When the last two digits are not 00:- If the last two digits are not 00, then the year is leap year if the year is divisible by 4. For example:- The year 2012 is leap year but 2014 is not a leap year.
+ 2
First, we check that if the year is divisible by 100 and then by 400, it is a leap year.
+ 1
leap year is the year that can divided by 4 or 400 only this means after every four year will came leap year thanks.