Skip to content

Instantly share code, notes, and snippets.

Created September 25, 2012 11:51
Show Gist options
  • Save anonymous/daa99d6b81022c341689 to your computer and use it in GitHub Desktop.
Save anonymous/daa99d6b81022c341689 to your computer and use it in GitHub Desktop.
numbers = (1..100)
numbers.each do |n|
if n % 3 == 0 and n % 5 == 0
n = puts "FizzBuzz"
elsif n % 3 == 0
n = puts "Fizz"
elsif n % 5 == 0
n = puts "Buzz"
end
puts n
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment