Created
February 12, 2017 10:59
-
-
Save kothiba/e93f43aa4c2b8e0e38b050ba7415362b to your computer and use it in GitHub Desktop.
I wrote FizzBuzz in Ruby
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
for num in 1..30 do | |
if num % 15 == 0 | |
puts "FizzBuzz" | |
elsif num % 5 == 0 | |
puts "Buzz" | |
elsif num % 3 == 0 | |
puts "Fizz" | |
else | |
puts num | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment