Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 759 Bytes

FizzBuzz.md

File metadata and controls

35 lines (29 loc) · 759 Bytes

FizzBuzz

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 output:

1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 Fizz 19 Buzz ... etc up to 100

Follow-up requirements

When you have the above program working, extend it with the following rules:

Multiples of 7 are “Whizz” Multiples of 11 are “Bang” That means for example that multiples of 3 & 7 are “FizzWhizz”, multiples of 5 & 11 are “BuzzBang” etc. Extend your printout so it continues beyond 100 and stops the first time you get “FizzBuzzWhizzBang”.