Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. Write a function that returns true or false depending on whether its input integer is a leap year or not.
  2. Begin on the top and work your way through the rules.
  3.  
  4. 1. A leap year is divisible by 4.
  5. Ex: 2001 is not a leap year. 1996 is a leap year.
  6.  
  7. 2. .. but leap years are not divisible by 100.
  8. Ex: 1900 is not a leap year.
  9.  
  10. 3. .. unless it's also divisble by 400.
  11. Ex: 2000 is a leap year.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement