Objective
A year is a leap year if it is divisible by 4, except century years (divisible by 100), which are only leap years if they are also divisible by 400. It is a good example of compound conditions with and, or and parentheses.
Instructions
- Read a year (integer).
- Show
year: is a leap yearif it is a leap year oryear: is not a leap yearif it is not.
2024
2024: is a leap year
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise