Created
August 1, 2017 15:38
-
-
Save FaisalFehad/7fda04a4281956386380ec7345f510a6 to your computer and use it in GitHub Desktop.
Prints bizz on multiple of 3, buzz on multiple of 5 and bizzbuzz on a multiple of both 3 and 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# prints bizz on multiple of 3, buzz on multiple of 5 and bizzbuzz on a multiple of both 3 and 5 | |
100.times do |i| | |
if i % 3 && i % 5 == 0 | |
puts "FizzBuzz" | |
elsif i % 3 == 0 | |
puts "Fiz" | |
elsif i % 5 == 0 | |
puts "Buzz" | |
else | |
puts i | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment