C++ Program to Print Series of Prime Number
Master C++ with Real-time Projects and Kickstart Your Career Start Now!!
Program 1
//Program to print series of prime number
#include<iostream>
using namespace std;
int main()
{
int n,i,f,limit,x=1;
system("cls");
cout<<"Enter a a limit";
cin>>limit;
while(x<=limit)
{
n=x;
f=0;
i=2;
while(i<n)
{
if(n%i==0)
{
f=1;
break;
}
i++;
}
if(f==0)
cout<<n<<endl
;
x++;
}
}
You give me 15 seconds I promise you best tutorials
Please share your happy experience on Google

