Created
April 8, 2016 09:52
-
-
Save byronmejia/116c3568d69f5d825f49c2b6b17532e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create an app that completes the following: | |
# - Leap Years | |
# - if x is divisible by 4, but not 100 | |
def leap(number) | |
(((number % 4) == 0) && !((number % 100) == 0)) | |
end | |
puts leap(4) | |
puts leap(100) | |
puts leap(8) | |
puts leap(120) | |
puts leap(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment