using namespace std;
int main()
{
int n,i,p=0;
cin>>n;
for(i=1;i<=n;i++)
{
if(n%i==0)
p++;
}
if(p==2)
{
cout<<"prime";
}
else
{cout<<"not prime";}
return 0;
}
using namespace std;
int main()
{
int n,i,p=0;
cin>>n;
for(i=1;i<=n;i++)
{
if(n%i==0)
p++;
}
if(p==2)
{
cout<<"prime";
}
else
{cout<<"not prime";}
return 0;
}
Found it
Just make the first character capital
if(p==2)
{
cout<<"Prime"; //P caps
}
else
{cout<<"Not Prime";} //N & P caps
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.