WAP that prints the number from 1 to 100. but for multiplies of
three print "XXX" instead of the number and for the multiplies of
five print "YYY" . for number which are multiplies of both three
and five print "ZZZ"
Answer Posted / abhisekh_banerjee
#include<stdio.h>
void main()
{
int i,n=0,m=0;
for(i=1;i<=100;i++)
{
n=i%3;
m=i%5;
if(n==0 && m!=0)
printf(" XXX ");
else if(m==0 && n!=0)
printf(" YYY ");
else if(n==0 && m==0)
printf(" ZZZ ");
else
printf("%d ",i);
}
}
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
What is bss in c?
What is the size of enum in c?
Why do we use stdio h and conio h?
Explain the difference between exit() and _exit() function?
Explain how many levels deep can include files be nested?
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
Explain null pointer.
What is data types?
How will you write a code for accessing the length of an array without assigning it to another variable?
Why isn't any of this standardized in c? Any real program has to do some of these things.
i want to know the procedure of qualcomm for getting a job through offcampus
What is adt in c programming?
What are compound statements?
Tell me is null always defined as 0(zero)?