here is a a program for checking that the number entered is prime number or not?
i basically use repl.it for online coding you can also use it is very simple to use and very user friendly thanks and have a look
#include <iostream>
using namespace std;
int main()
{
int n,count,j;
cin>>n;
for(j=2;j<n;j++)
{
if(n%j==0)
{
count=1;
break;
}
using namespace std;
int main()
{
int n,count,j;
cin>>n;
for(j=2;j<n;j++)
{
if(n%j==0)
{
count=1;
break;
}
}
if(count==0)
{
cout<<"prime number";
}
else
{
cout<<"not prime";
}
}
if(count==0)
{
cout<<"prime number";
}
else
{
cout<<"not prime";
}
}
Output
check that the number entered is a prime number or not?

0 comments: