Created
July 28, 2017 16:42
-
-
Save neet/e13e53a339c0bd1cfb54e2aef0794f2f to your computer and use it in GitHub Desktop.
FizzBuzz.rb
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
i = 1 | |
while i <= 100 do | |
if i % 3 == 0 | |
puts "Fizz" | |
elsif i % 5 == 0 | |
puts "Buzz" | |
elsif i % 3 == 0 and i % 5 == 0 | |
puts "FizzBuzz" | |
else | |
puts i.to_s | |
end | |
i += 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment