A leap year happens every four years, so it's a year that is perfectly divisible by four.
However, if the year is a multiple of 100 (1800, 1900, etc), the year must be divisible by 400 to be leap.
Write a function that determines if the year is a leap year or not.
Examples:
year = 2020 ➞ true year = 2021 ➞ false year = 1968 ➞ true year = 1900 ➞ false
Video Solution:
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check
