Check Leap Year in Java

Check Leap Year in Java

Here you will get the program code to check leap year in java programming.

A leap year is a year that has an extra day, February 29th, to keep our calendar in alignment with the Earth’s revolutions around the Sun, occurring every four years.

Program to Check Leap Year in Java

Output

C:\CodeRevise\java>javac CheckLeapYear.java

C:\CodeRevise\java>java CheckLeapYear
Enter a year : 2001
2001 is not a leap year.

C:\CodeRevise\java>java CheckLeapYear
Enter a year : 2004
2004 is a leap year.

C:\CodeRevise\java>java CheckLeapYear
Enter a year : 2020
2020 is a leap year.

 

 

Check out our other Java Programming Examples

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top