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

EXPLAIN #INCLUDE<STDIO.H> EXPLAIN #INCLUDE<CONIO.H>

4 Answers  


Write a program which has the following seven functions. The functions should be: • main() this calls the other 6 functions • fget_long() a function which returns a long data type from a file • fget_short() a function which returns a short integer variable from a file • fget_float() a function which returns a floating point variable from a file • fprt_long() a function which prints its single, long argument into a file • fprt_short() a function which prints its single, short argument into a file • fprt_float() a function which prints its single, floating point argument into a file. You should use fscanf() to get the values of the variables from the input (the file) and fprintf() to print the values to the other file. Pay attention to using the correct format for each of the data types.

0 Answers  


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

0 Answers  


what will be the output of the following program, justify? #define TEST int TEST getdata() { static i; i+=10; return i; } main() { int k; k = getdata(); }

3 Answers  


c program for searching a student details among 10 student details

0 Answers  






When should structures be passed by values or by references?

0 Answers   Adobe,


What is .obj file in c?

0 Answers  


List the difference between a While & Do While loops?

0 Answers   Accenture,


What is the difference between if else and switchstatement

0 Answers  


Can a pointer point to null?

0 Answers  


What is const keyword in c?

0 Answers  


Explain what is the difference between functions abs() and fabs()?

0 Answers  


Categories