12. Leap Year
Foundation1000 ms256 MBSolved by 0%
Read a year and print Yes if it is a leap year, or No if it is not.
A year is a leap year when it is divisible by 4, except that years divisible by 100 are not leap years, unless they are also divisible by 400.
So 1996 is a leap year, 1900 is not, and 2000 is.
Constraints - `1 ≤ year ≤ 10000`
Input
A single line containing one integer n.
Output
Print exactly one word: Yes or No.
Input1996
OutputYes
Noteis divisible by 4 and not by 100
Input1900
OutputNo
Noteis divisible by 100 but not by 400 — the exception most solutions miss
Hint 1Approach
Hint 2Approach
Hint 3Pseudocode
Hint 4Full solution