Java Program for Leap Year

Here you will get java program for leap year.

Condition for Leap Year

A year completely divisible by 400 is leap year.

A year completely divisible by 4 but not divisible by 100 is leap year.

For example: 2000, 2008, etc are leap year while 1900, 1997, etc are not leap year.

Java Leap Year Program

 

Output

Enter a year (Ex: 1990):
1996
leap year

Enter a year (Ex: 1990):
1900
not leap year

Leave a Reply

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