Skip to content

This is a simple Java program that checks whether a given year is a leap year or not.

License

Notifications You must be signed in to change notification settings

jiahujiahu/Leap-Year

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Leap Year Checker

This is a simple Java program that checks whether a given year is a leap year or not.

How it Works

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.

Example

Enter a year: 2024
2024 is a leap year.
Enter a year: 2021
2021 is not a leap year.

About

This is a simple Java program that checks whether a given year is a leap year or not.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages