write a c program that prints all multiples of 3between 1
and 50.

Answers were Sorted based on User's Feedback



write a c program that prints all multiples of 3between 1 and 50...

Answer / yamuna

/*A.Yamuna III BSc CS L.R.G. COLLEGE,TIRUPUR*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
printf("The multiples of 3 between 1 and 50 are :");
for(a=1;a<=50;a++)
{
if(a%3==0)
{
printf("\n%d",a);
}
}
getch();
}

Is This Answer Correct ?    47 Yes 6 No

write a c program that prints all multiples of 3between 1 and 50...

Answer / dj

#include<stdio.h>
#include<conio.h>
Void main()
{
int i;
for(i=1;i<=50;i++)
{
if(i%3==0)
{
printf("%d",i);
}
}
grtch();
}

Is This Answer Correct ?    24 Yes 13 No

write a c program that prints all multiples of 3between 1 and 50...

Answer / narsi

#include<stdio.h>
#include<conio.h>
void main()
{
int n1,n2;
n1=1;
n2=50;
while(n1<=n2)
{
if(n1%3==0)
printf("%d ",n1);
n1=n1+1;
}
}

Is This Answer Correct ?    12 Yes 4 No

write a c program that prints all multiples of 3between 1 and 50...

Answer / pruthiewraj swain

#include<stdio.h>
#include <conio.h>
voidmain()
{
int a ;
printf("enter the multiples of 3");
while (a=100)
{
if (a%3==0|| a%4==0)
}
printf("
%d",a);
}}
getch();
}

Is This Answer Correct ?    0 Yes 0 No

write a c program that prints all multiples of 3between 1 and 50...

Answer / hemanth

#include<stdio.h>
#include<conio.h>
void main()
{
int n1,n2;
n1=1;
n2=50;
while(n1<=n2)
{
if(n1%3==0)
printf("%d ",n1);
n1=n1+1;
}
}

Is This Answer Correct ?    5 Yes 6 No

Post New Answer

More C Interview Questions

What is the difference between variable declaration and variable definition in c?

0 Answers  


What is return type in c?

0 Answers  


When is a “switch” statement preferable over an “if” statement?

0 Answers  


What is meant by int main ()?

0 Answers  


extern static int i func() { i =10; i++; printf("%d \n",i); } main() { i =20; printf("%d \n",i); func(); printf("%d \n",i); }

2 Answers  






code for quick sort?

0 Answers  


what is the difference b/w compiler and debugger?

2 Answers   Assurgent,


triangle number finding program...

1 Answers   HCL,


Given an array of numbers, except for one number all the others occur twice. Give an algorithm to find that number which occurs only once in the array.

6 Answers  


Is struct oop?

0 Answers  


What are the two forms of #include directive?

0 Answers   Aspire, Infogain,


Explain output of printf("Hello World"-'A'+'B'); ?

0 Answers  


Categories