Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fizzbuzz
- 1.upto(100) do |number|
- output = ""
- output += "Fizz" if number % 3 == 0
- output += "Buzz" if number % 5 == 0
- output += number.to_s if output.empty?
- puts output
- end
- end
- fizzbuzz
Add Comment
Please, Sign In to add comment