#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,p,t;
clrscr();
printf("Enter any number, n = ");
scanf("%d",&n);
if(n<2)
p=0;
else
{
p=1;
t=n/2;
for(i=2;i<=t;i++)
if(n%i==0)
{
p=0;
break;
}
}
if(p==1)
printf("%d is Prime number",n);
else
printf("%d is not Prime number",n);
getch();
}
///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........