Javascript Fizzbuzz

Javascript Fizzbuzz

FIZZBUZZ

Conditions

  • Print the Number 1-100
  • If the Number is divisible by 3 print FIZZ
  • if the Number is divisible by 5 print BUZZ
  • if the Number is divisible by both 3 and 5 print FIZZBUZZ

    Codes

    Javascript
    for(let i =0; i<=100;i++){
      if(i%3==0 && i%5!=0){
          console.log("fizz");
      }else if(i%5==0 && i%3!=0){
          console.log("buzz");
      }else if(i%5==0 && i%3==0){
          console.log("fizzbuzz");
      }else{
          console.log(i);
      }
    }