Created
March 22, 2012 21:29
-
-
Save johana-star/2164704 to your computer and use it in GitHub Desktop.
FizzBuzz in Ruby
This file contains hidden or 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
(0..100).each do |number| | |
case | |
when number % 15 == 0 then puts "FizzBuzz" | |
when number % 5 == 0 then puts "Buzz" | |
when number % 3 == 0 then puts "Fizz" | |
else puts number | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment