Question
Write a program that prints numbers from 1 to 100. But for multiple of 3 print "fizz" instead of the number and for the multiples of 5 print "Buzz".for numbers which are multiple of 15 print "FizzBuzz".
Answers
Answered by
2
Explanation:
#include <stdio.h>
int main()
{
int i;
for(i=1;i<=100:i++)
{
if(i%3==0)
{
printf("fizz\n");
}
else if(i%5==0)
{
printf("Buzz\n");
}
else if(i%5==0 && i%3==0)
{
printf("fizzBuzz\n");
}
else
{
printf("%d\n",i);
}
Similar questions