Fizzbuzz
Input: Standard Input (stdin)
Output: Standard Output (stdout)
Memory limit: 100 megabytes
Time limit: 1.0 seconds
Output: Standard Output (stdout)
Memory limit: 100 megabytes
Time limit: 1.0 seconds
Write a program that counts from 1 to N but for every number divisible by 3 print “Fizz” and for every number divisible by 5 print “Buzz”. If a number is both a multiple of 3 and 5 print “FizzBuzz”.
Hint: use the remainder operator %.
-
Sample Input 1
5
Sample Output 1
1 2 Fizz 4 Buzz