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
In C programming, how do you insert quote characters (‘ and “) into the output screen?
Explain the use of keyword 'register' with respect to variables.
Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
What is int main () in c?
State the difference between realloc and free.
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
What is wrong with this initialization?
How is = symbol different from == symbol in c programming?
What is abstract data structure in c?
What is union in c?
Differentiate call by value and call by reference?
Where we use clrscr in c?
Why main is used in c?
what are the 10 different models of writing an addition program in C language?