GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Modul 10 von 18 · Medien

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.

Anleitung

Um im Kurs weiterzukommen, sende einen Versuch dieses Quiz ab. Du kannst ihn nach der letzten Frage absenden.

Zum gewählten Modul

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck