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"
Answers were Sorted based on User's Feedback
Answer / abhisekh_banerjee
#include<stdio.h>
void main()
{
int i,n=0,m=0;
for(i=1;i<=100;i++)
{
n=i%3;
m=i%5;
if(n==0 && m!=0)
printf(" XXX ");
else if(m==0 && n!=0)
printf(" YYY ");
else if(n==0 && m==0)
printf(" ZZZ ");
else
printf("%d ",i);
}
}
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / 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 |
write a program for egyptian fractions in c?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
What is pass by value in c?
what is bitwise operator?
What are the 4 types of organizational structures?
What are keywords c?
c program to subtract between two numbers without using '-' sign and subtract function.
wtite a program that will multiply two integers in recursion function
What are the uses of pre-processor directives?
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
what is the different bitween abap and abap-hr?