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 / vadivel t
#include<stdio.h>
main()
{
int i;
for(i = 1 ; i<=100; i++)
{
if((i%5 == 0) && (i%3 == 0))
printf("ZZZ \n");
else if(i%3 == 0)
printf("XXX \n");
else if(i%5 == 0)
printf("YYY \n");
else
printf("%d \n",i);
}
_getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are the types of functions in c?
find out largest elemant of diagonalmatrix
what are the different storage classes in c?
What is c language used for?
What does *p++ do? What does it point to?
What is the best way of making my program efficient?
Explain about the constants which help in debugging?
What is the difference between procedural and declarative language?
Write the control statements in C language
What is wrong in this statement?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
What are the different file extensions involved when programming in C?
Using which language Test cases are added in .ptu file of RTRT unit testing???
Differentiate fundamental data types and derived data types in C.