/* 3 program of prime number Note=> 1 is not prime number */
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int i,n,flag=0;
clrscr();
printf("Enter a number:");
scanf("%d",&n);
for(i=2;i<=sqrt(n);i++)
{
if(n%i==0)
flag=1;
}
if(flag==1)
printf("Not prime number ");
else
printf("Prime number ");
getch();
}
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int i,n,flag=0;
clrscr();
printf("Enter a number:");
scanf("%d",&n);
for(i=2;i<=sqrt(n);i++)
{
if(n%i==0)
flag=1;
}
if(flag==1)
printf("Not prime number ");
else
printf("Prime number ");
getch();
}