Practice · 2 of 5
Leap year, precisely specified
CHALLENGE
Difficulty: beginner+25 XP
Implement boolean isLeapYear(int year). The full rule: divisible by 4 → leap, EXCEPT centuries — divisible by 100 is NOT leap unless also divisible by 400. So 2000 was leap, 1900 was not, 2024 is.
Press Submit to check your solution.
Back to lesson: Practice: Practice: Decisions