FIZZBUZZ IN JS
- shishantpandey
- Aug 23, 2022
- 1 min read
Updated: Aug 28, 2022
for (let i = 0; i < 101; i++) { if (i % 3 != 0 && i % 5 != 0) { document.write(i, ","); } if (i > 0 && i % 3 == 0 && i % 5 != 0) { document.write("Fizz", " ,"); } if (i > 0 && i % 5 == 0 && i % 3 != 0) { document.write("Buzz", ","); } if (i > 0 && i % 3 == 0 && i % 5 == 0) { document.write("FizzBuzz", ","); } }

Comments