Created
February 26, 2014 02:26
-
-
Save frank-lsf/9222325 to your computer and use it in GitHub Desktop.
Fizz Buzz
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
(1..100).each do |i| | |
if i % 15 == 0 | |
puts 'FizzBuzz' | |
elsif i % 5 == 0 | |
puts 'Buzz' | |
elsif i % 3 == 0 | |
puts 'Fizz' | |
else | |
puts i | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment