Can you help me


Oops, try again. You printed Fizz when you should have printed FizzBuzz

<do not remove the three backticks below

for(i = 1; i < 21; i++){
if(i%3 === 0 ){
else if(i%5 === 0){
else if(i%3 === 0 && i%5 === 0){


for i=15, if is true (15 is divisible by 3), so fizz is printed, the loop moves on to the next number

how can we overcome this problem? what could we change? Maybe the order in which we check if the number if fizz, buzz or fizzbuzz?


I just changed the order. Check for the number being divisible by both 3 and 5 first the do the rest


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.