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


Please Help Members By Posting Answers For Below Questions

What is #define size in c?

640


What are the c keywords?

745


Write program to remove duplicate in an array?

595


The statement, int(*x[]) () what does in indicate?

640


What is the difference between ++a and a++?

686






write a program to print largest number of each row of a 2D array

1866


What does typeof return in c?

635


Why does not c have an exponentiation operator?

624


Why c is called top down?

624


Write a program to know whether the input number is an armstrong number.

663


What is union in c?

630


What is far pointer in c?

803


Why c is a procedural language?

578


Is printf a keyword?

755


What is table lookup in c?

622