Write a program to print prime nums from 1-20 using c
programing?
Answer Posted / aniruddha tripathi
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,m,i;
clrscr();
printf("\n ENTER THE NUMBER");
scanf("%d",&n);
i=2;
ab:mfmod(n,i);
if(m==0);
{
printf("\n it is not prime");
goto bc;
]
else
{
i=i+1;
if(i<=(n-1))
{
goto ab;
}
printf("\n it is a prime no.");
}
bc;
getch();
}
Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is static memory allocation? Explain
How can you return multiple values from a function?
What is the best way of making my program efficient?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
How can a number be converted to a string?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What are terms in math?
What is the use of typedef in structure in c?
Do you know the purpose of 'register' keyword?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
What is a macro?
How will you delete a node in DLL?
Differentiate between new and malloc(), delete and free() ?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above