Exercises on Control Flow
Enhance your programming by practicing loops and conditionals.
We'll cover the following
The solutions for the exercises are included in the solution tabs. For best learning outcomes, don’t look at these unless you’ve attempted the problems yourself.
Question 1: FizzBuzz
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 the multiples of 5, print “Buzz” instead of the number.
- For numbers that are multiples of both 3 and 5, print “FizzBuzz” instead.
Try solving here:
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy