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 / raju kalyadapu

int main()
{
int i;
while(++i<=100)
{
if(i%3==0)
printf("XXX
");
  else if(i%5==0)
  printf("YYY
");
else if(i%3==0&&i%5==0)
printf("ZZZ
");
printf("%d
",i);
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can I avoid the abort, retry, fail messages?

574


What is data structure in c programming?

557


When a c file is executed there are many files that are automatically opened what are they files?

576


Explain about the functions strcat() and strcmp()?

586


Should a function contain a return statement if it does not return a value?

575






When we use void main and int main?

572


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

642


What are the different types of data structures in c?

582


Explain the properties of union.

593


Explain how do you use a pointer to a function?

621


#include { printf("Hello"); } how compile time affects when we add additional header file .

1412


What is the purpose of 'register' keyword in c language?

604


`write a program to display the recomended action depends on a color of trafic light using nested if statments

1620


How many data structures are there in c?

599


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

679