← Back
Code Challenge 2.4 - Fizz Buzz
Objective
Your task is to write a program that prints numbers from 1 to 100. However, for multiples of three, print “Fizz” instead of the number, and for multiples of five, print “Buzz.” For numbers which are multiples of both three and five, print “FizzBuzz.”
Skills to Practice
- Repeating statements using loops
- Making decisions using if statements
- Checking for divisibility
Challenge Tasks
- Create a console project named Challenge 2-4.
- Print numbers from 1 to 100
- Replace multiples of three with the word “Fizz”
- Replace multiples of five with the word “Buzz”
- Replace multiples of both tree and five with the word “FizzBuzz”
Sample Output
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
... Remaining output omitted