Skip to content

Instantly share code, notes, and snippets.

@noqcks
Created September 3, 2014 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noqcks/0ee2db10ce15ac6c9704 to your computer and use it in GitHub Desktop.
Save noqcks/0ee2db10ce15ac6c9704 to your computer and use it in GitHub Desktop.
def fizzbuzz(startNum,endNum)
startNum.upto(endNum) 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment