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

An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

677


What do you mean by c what are the main characteristics of c language?

577


a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none

729


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

1637


Is boolean a datatype in c?

555






State two uses of pointers in C?

644


What is the difference between array_name and &array_name?

783


What are global variables and how do you declare them?

625


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2381


Can you pass an entire structure to functions?

702


Explain what is meant by 'bit masking'?

650


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

655


write a program to print data of 5 five students with structures?

1616


Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record

4748


The file stdio.h, what does it contain?

672