¡GoConqr estrena diseño! Cuéntanos qué te parece.

Módulo 10 de 18 · Multimedia

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.

Instrucciones

Para avanzar en el curso, envía un intento de este test. Puedes enviarlo después de la última pregunta.

Ir al módulo elegido

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?