Skip to content

Instantly share code, notes, and snippets.

@timothyandrew
Created September 16, 2011 15:04
Show Gist options
  • Save timothyandrew/1222314 to your computer and use it in GitHub Desktop.
Save timothyandrew/1222314 to your computer and use it in GitHub Desktop.
FizzBuzz
#!/usr/bin/env ruby
for i in 1..100
if(i % 5 == 0 and i % 3 == 0)
puts "FizzBuzz"
elsif(i % 3 == 0)
puts "Fizz"
elsif(i % 5 == 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