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:
leapYear(2020) ➞ true leapYear(2021) ➞ false leapYear(1968) ➞ true leapYear(1900) ➞ false
Video Solution:
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check