/FizzBuzz

Little program that prints Fizz if divisible by 3, Buzz if divisible by 5, and FizzBuzz if divisible by both.

Primary LanguageRuby

Fizz Buzz

Instructions

Write a program that prints out the numbers from 1 to 100, each on a new line.

  • If the number is divisible by 3, print out the word "Fizz" instead.
  • If the number is divisible by 5, print out the word "Buzz" instead.
  • If the number is divisible by 3 and 5, print out the word "FizzBuzz" instead.

Sample Output

1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
... omitted for brevity