#include<iostream.h>
#include <math.h>
void main()
{
int number;
cout<<" ---------------------------------------------"<<endl;
cout<<" Enter a number to find if its a prime number "<<endl;
cout<<" ---------------------------------------------"<<endl;
cin>>number;
bool a =true;
for(int i=2;i<sqrt(number);i++) //check untill the square root
{
if(number%i==0) // if it is divisible it is non prime
{
a=false;
break;
}
}
if(a==false)
cout<<number<<" is not a prime number"<<endl;
else
cout<<number<<" is a prime number"<<endl;
}