diff --git a/problem.js b/problem.js index de066e3..8c20e40 100644 --- a/problem.js +++ b/problem.js @@ -5,7 +5,10 @@ function fizzBuzz(){ //If divisible by 3 and 5, print fizzbuzz //Else, print the number for(i=1;i<=100;i++){ - if(i % 3 === 0){ + if(i % 3 == 0 && i % 5 == 0){ + console.log("fizzbuzz"); + } + else if(i % 3 === 0){ console.log("fizz"); } else if(i % 5 === 0){ @@ -17,4 +20,4 @@ function fizzBuzz(){ } } -fizzBuzz(); \ No newline at end of file +fizzBuzz();