Skip to content

Instantly share code, notes, and snippets.

@stupeters187
Last active March 29, 2016 16:58
Show Gist options
  • Save stupeters187/8bb7b2b6c25fd874315bf415e2fc3c79 to your computer and use it in GitHub Desktop.
Save stupeters187/8bb7b2b6c25fd874315bf415e2fc3c79 to your computer and use it in GitHub Desktop.
def fizzbuzz(a, b)
a.upto(b) do |i|
if i % 5 == 0 && i % 3 == 0
puts "FizzBuzz"
elsif i % 5 == 0
puts "Buzz"
elsif i % 3 == 0
puts "Fizz"
else
puts i
end
end
end
fizzbuzz(300, 400)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment