write a c program that prints all multiples of 3between 1
and 50.
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
EXPLAIN #INCLUDE<STDIO.H> EXPLAIN #INCLUDE<CONIO.H>
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.
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
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(); }
c program for searching a student details among 10 student details
When should structures be passed by values or by references?
What is .obj file in c?
List the difference between a While & Do While loops?
What is the difference between if else and switchstatement
Can a pointer point to null?
What is const keyword in c?
Explain what is the difference between functions abs() and fabs()?