Skip to content

mannibasi/leap-year

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

leap-year

Instructions

Implement a method that checks if a year is a leap year.

All the following rules must be satisfied:

  • A year is not a leap year if not divisible by 4
  • A year is a leap year if divisible by 4
  • A year is a leap year if divisible by 400
  • A year is not a leap year if divisible by 100 but not by 400

Examples:

  • 1997 is not a leap year (not divisible by 4)
  • 1996 is a leap year (divisible by 4)
  • 1600 is a leap year (divisible by 400)
  • 1800 is not a leap year (divisible by 4, divisible by 100, NOT divisible by 400)

The method should return true if a year is a leap year, and false if it is not.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages