Skip to content

Instantly share code, notes, and snippets.

@octosteve
Created November 22, 2011 05:13
Show Gist options
  • Save octosteve/1384946 to your computer and use it in GitHub Desktop.
Save octosteve/1384946 to your computer and use it in GitHub Desktop.
FizzBuzz
1.upto(100) do |num|
if num % 3 == 0 || num % 5 == 0
if num % 3 == 0
print "Fizz"
end
if num % 5 == 0
print "Buzz"
end
else
print num
end
puts
end
@octosteve
Copy link
Author

Nice! I didn't think to check for '15'... where's your print statements?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment