Skip to content

Latest commit

 

History

History
30 lines (27 loc) · 620 Bytes

File metadata and controls

30 lines (27 loc) · 620 Bytes

Description

Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

Sample

Input: 1 Output: 1
Input: 2 Output: 2
Input: 3 Output: fizz
Input: 4 Output: 4
Input: 5 Output: buzz
Input: 6 Output: fizz
...
Input: 10 Output: buzz
...
Input: 15 Output: fizzbuzz
...

Extentions

  • Return "fizz", "buzz" or "fizzbuzz" if a number contains 3, 5 or both.
Input: 13 Output: fizz
Input: 51 Output: buzz
Input: 53 Output: fizzbuzz