CJCoding With Joseph

FizzBuzz 1 to N

Read an integer N from input. Use a loop over 1..N and print, one per line: FizzBuzz if the number is divisible by both 3 and 5, otherwise Fizz if divisible by 3, otherwise Buzz if divisible by 5, otherwise the number itself. For input 5 the exact output is:

1
2
Fizz
4
Buzz

Expected Output:

1
2
Fizz
4
Buzz
Topics:
Loops
๐Ÿ“ฅ Auto-Input:
5\n
This input is automatically fed to your program's stdin
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cout, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.