//Prime number program in dev C++.
#include<iostream>
using namespace std;
int main()
{
int i,num;
cout<<"Enter number:-\n";
cin>>num;
if(num==1)
{
cout<<"1 is not a prime number and smallest prime number is 2";
}
for(i=2;i<num;i++)
{
if(num%i==0)
{
cout<<"number is not prime number";
break;
}
}
if(num==i)
{
cout<<"number is prime number";
}
return 0;
}
#include<iostream>
using namespace std;
int main()
{
int i,num;
cout<<"Enter number:-\n";
cin>>num;
if(num==1)
{
cout<<"1 is not a prime number and smallest prime number is 2";
}
for(i=2;i<num;i++)
{
if(num%i==0)
{
cout<<"number is not prime number";
break;
}
}
if(num==i)
{
cout<<"number is prime number";
}
return 0;
}