Guest User

Untitled

a guest
Apr 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. # Exercise 4
  2. (1..100).each do |i|
  3. remainders = [i % 3] << i % 5
  4. if (!remainders.include? 0)
  5. puts i
  6. else
  7. puts "#{"Fizz" if remainders[0] == 0}#{"Buzz" if remainders[1] == 0}"
  8. end
  9. end
Add Comment
Please, Sign In to add comment