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
Chemistry,
15 days ago
Environmental Sciences,
15 days ago
Science,
1 month ago
Physics,
8 months ago
Math,
8 months ago