Skip to content

Instantly share code, notes, and snippets.

@geopet
Created September 19, 2012 04:39
Show Gist options
  • Save geopet/3747712 to your computer and use it in GitHub Desktop.
Save geopet/3747712 to your computer and use it in GitHub Desktop.
Ruby FizzBuzz
for i in 1..100
if i % 5 == 0 and i % 3 == 0
puts "fizzbuzz"
elsif i % 5 == 0
puts "fizz"
elsif i % 3 == 0
puts "buzz"
else
puts i
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment