# C Program To Get “Fizz” , “Buzz” and “FizzBuzz”

#### Question

Write a program that prints the numbers from 0 to N. But for multiples of three print **“Fizz”** instead of the number and for the multiples of five print** “Buzz”**. For numbers which are multiples of both three and five and Zero ( multiples of any numbers ) then print **“FizzBuzz”**.

FizzBuzz is a very simple programming task, asked in software developer job interviews, to determine whether the job candidate can actually write code.

##### Input Format:

We need to enter the number N to print Fizz ,Buzz and FizzBuzz upto N.

##### Output Format:

Print the result upto N.But for multiples of 3 print “Fizz” instead of the number and for the multiples of 5 print “Buzz”. Print “FizzBuzz” if the number multiples of 3 instead of number.

#### Sample Output

### Logic

- Get the N value from user.
- Using For Loop check the number from 0 to N.
- If the number Divisible by both 3 and 5 then print “FizzBuzz”.
- If the number multiplies of 3 then print “Fizz”.
- If the number is multiplies of 5 then print “Buzz”.
- If the number is multiplies of both 3 and 5 then print “FizzBuzz”.
- If the above three condition is not satisfied then print that number.

### Program

#include<stdio.h> int main() { int i,N; scanf("%d",&N); for(i=0;i<=N;i++) { if((i%3==0&&i%5==0))//Number Divisible by 3 and 5 { printf("FizzBuzz "); continue; } if(i%3==0)//Number Divisible by 3 { printf("Fizz "); continue; } else if(i%5==0)//Number Divisible by 5 { printf("Buzz "); continue; } else printf("%d ",i); } return 0; }