C++ PROGRAM FOR PRIME NUMBERS USING IOSTREAM February 23, 2015 Get link Facebook X Pinterest Email Other Apps #include<iostream> #include<conio.h> using namespace std; int main(){ int i,j,n,flag; cout<<"Enter max. limit: "; cin>>n; for(i=2;i<=n;i++) { flag=0; { if(i%j==0) flag++; } if(flag==0) cout<<i<<"\t"; } getch(); } Output: Comments
Comments
Post a Comment