Leap years have an extra day in February, making it 29 days long instead of the usual 28. A leap year occurs mostly every four years. The rules are:
For example (user input in green):
Welcome to the leap year calculator 📅 🦘 Enter start year: 2000 Enter end year: 2050 Leap years: 2000 2004 2008 2012 2016 2020 2024 2028 2032 2036 2040 2044 2048 There are 13 leap years between 2000 and 2050
Another example:
Welcome to the leap year calculator 📅 🦘 Enter start year: 1599 Enter end year: 1602 Leap years: 1600 There is 1 leap year between 1599 and 1602
%. For example, year % 4 == 0 checks if year divided by 4 has remainder 0 and is thus evenly divisible.