For an year to be leap according to the Gregorian calendar, the following condition(conditions) should be satisfied.
"The year should be divisible by 4. If the year is divisible by 100 also, then it should be divisible by 400 as well."
(By divisible, we mean exactly divisible, i.e., with no remainder.)
So for an year to be leap
1. Check if the year is divisible by 4. If not divisible, its not a leap year. No further checks needed.
2. If divisible by 4, then check if the year is divisible by 100. If not divisible, it is a leap year. No further checks necessary.
3. If divisible by 100, check if the year is divisible by 400. If divisible by 400, then it is a leap year, else it is not a leap year.
If [not divisible by 4] then [not a leap year]
else if [not divisible by 100] then [leap year]
else if [divisible by 400] then [leap year]
else [not a leap year]
|No||No(not required)||No(not required)||No|
|1986||No||Not required||Not required||NO|