Exercise: FizzBuzz
Write code to solve the problem.
Question
Write a program that prints the numbers from 1 to 100 with the following exceptions:
- For multiples of 3, print ‘Fizz’ instead of the number.
- For multiples of 5, print ‘Buzz’ instead of the number.
- For numbers that are multiples of both 3 and 5, print ‘FizzBuzz’ instead.
Exercise: FizzBuzz
Write code to solve the problem.
Question
Write a program that prints the numbers from 1 to 100 with the following exceptions:
- For multiples of 3, print ‘Fizz’ instead of the number.
- For multiples of 5, print ‘Buzz’ instead of the number.
- For numbers that are multiples of both 3 and 5, print ‘FizzBuzz’ instead.