c++ program to find the prime number

c++ program to find the prime number


#include <iostream>
using namespace std;
int main ()
{

int number , count =0;
cout<<"enter a number : "<<endl;
cin>>number;
for ( int i=1;i<=number ; i++ )
{
if ( number % i == 0  )
{
count++;
}
}
if ( count == 2 )
{
cout<<"the number : "<<number<<" is prime ."<<endl;
}
else {
cout<<"the number : "<<number<<" is not prime ."<<endl;
}

}