0

Fizzbuzz js

you can write a functional that outputs a number from 1 to n on the console, where n is an integer that functions using a parameter used by the conditions: output hiss instead of numbers multiples of 3; output buzzing instead of numbers multiples of 5; detection of hiss instead of numbers multiples of 3 and 5. You need to make the code output to the number 1046783

18th Jun 2022, 9:29 AM
denakk0
3 Answers
+ 3
Instead of 100 in for loop you need to take the input variable of this number.
18th Jun 2022, 9:55 AM
JaScript
JaScript - avatar
+ 1
So what is your question? Need help solving? Show your attempt.
18th Jun 2022, 9:44 AM
Chris Coder
Chris Coder - avatar
0
for (let n = 1; n<=100; n++) { if (n % 15 == 0) console.log("fizzbuzz"); else if (n % 5 == 0) console.log("buzz"); else if (n % 3 == 0) console.log("fizz"); else console.log(n); } how to create so that I had not a limit to 100 but to 1046783?
18th Jun 2022, 9:51 AM
denakk0