code name :- To Check number is prime number or not, or sir give me another code to check the number is prime number or not.
CODE :-
#include
using namespace std;
int main()
{
int a,n,i=2;
cout<<“Enter the number”<<endl;
cin>>n;
for(int i=2;i<n;i++)
{
if(n%i==0)
{
i++;
}
}
if(n%i==0){
cout<<"The number is not prime";
}
else cout<<"The numer is prime number";
return 0;
}