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
Explain how do you list a file’s date and time?
why we wont use '&' sing in aceesing the string using scanf
Why doesnt the call scanf work?
What is int main () in c?
What is the heap?
When is the “void” keyword used in a function?
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
How to find a missed value, if you want to store 100 values in a 99 sized array?
How can I handle floating-point exceptions gracefully?
What is function definition in c?
What is the purpose of macro in C language?
What is the purpose of scanf() and printf() functions?
Explain what are compound statements?
Differentiate between static and dynamic modeling.
What is a spanning Tree?