Practice
FizzBuzz
MEDIUMLoops
Read a positive integer N. For each number from 1 to N, output:
- FizzBuzz if divisible by both 3 and 5
- Fizz if divisible by 3 only
- Buzz if divisible by 5 only
- The number itself otherwise
Input: A positive integer N. Output: N lines, one per number.
Example (N = 5):
1
2
Fizz
4
Buzz
Premium is coming soon. All grading features are currently unlocked.
Sample Test Cases
Test 1: First 5
Inputs: 5
Expected: 1
2
Fizz
4
Buzz
Test 2: First 15 (includes FizzBuzz)
Inputs: 15
Expected: 1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
Ctrl+Enter
Press Ctrl+Enter to run your code
or Ctrl+Shift+Enter to grade