Our Recommendation for You Search your Query, You can find easily. for example search by book name or course name or any other which is related to your education

Followers

How To Find Prime Number in C++ which is enter by user

  How To Find Prime Number in C++

 

it is the Simple program which will find the prime number in the first 100 number which is entered by the user you can increase its range by include the 11 13 and 17 and so on to the condition of if statement.
#include<istream.h>
int main()
{
int a;
cout<<"Program that Find Prime Number in first 100 numbers"<<endl;
cout<<"please enter the number for 1 to 100"<<endl;
cin>>a;
if(a%2!=0&&a%3!=0&&a%5!=0&&a%7!=0||a==1||a==2||a==3||a==5||a==7)
{
cout<<"Prime Number"<<endl;
}
else
cout<<"Not Prime Number"<<endl;
system("Pause");
return 0;
};