This is a simple Java program that checks whether a given year is a leap year or not.
The program takes a year as input and determines if it is a leap year based on the following criteria:
- If the year is divisible by 4, it is a potential leap year.
- However, if the year is divisible by 100, it is not a leap year, unless...
- ...the year is also divisible by 400, in which case it is a leap year.
The program performs these checks and outputs whether the year is a leap year or not.
Enter a year: 2024
2024 is a leap year.
Enter a year: 2021
2021 is not a leap year.