Girl Develop It Buffalo

JS101 Class 2 Exercises: for Loops

Home

FizzBuzz

Write a for loop that will iterate from 1 to 20. For each iteration: if the current number is divisible by 3 print Fizz, if the number is divisible by 5 print Buzz, if both say FizzBuzz, otherwise simply print the number

Hint:The modulus operator (%) can be used to get the remainder of dividing the left operand by the right operand