GoConqr has a new look! Let us know what you think.

Module 10 of 18 · Media

FizzBuzz problem

Kostas Diakogiannis

FizzBuzz problem

D1 - The FizzBuzz Problem

Write  a single script that stores a single integer into a variable. This integer can be anything between 1 and 100. 

Then write a script that prints different things to the console based on the number provided.

Specifically:

If the number is multiple of 3 (3, 6, 9 etc) print 'Fizz' to the console.

If the number is multiple of 5 (5, 10 etc) print 'Buzz'

If it's multiple of both 3 and 5 (15, 30, 45) then print 'FizzBuzz'

Otherwise print the number itself.

Test that your script works by changing the number regularly. Check all cases work properly.

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?