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