Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Write a function that returns true or false depending on whether its input integer is a leap year or not.
- Begin on the top and work your way through the rules.
- 1. A leap year is divisible by 4.
- Ex: 2001 is not a leap year. 1996 is a leap year.
- 2. .. but leap years are not divisible by 100.
- Ex: 1900 is not a leap year.
- 3. .. unless it's also divisble by 400.
- Ex: 2000 is a leap year.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement