You can get code of this C++ here ; DOWNLOAD C++ code
Here you can list prime number by entered maximum range, the code are shown below :
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
int num,i,count,n;
cout << "Enter max range: ";
cin >> n;
for(num = 1;num<=n;num++){
count = 0;
for(i=2;i<=num/2;i++){
if(num%i==0){
count++;
break;
}
}
if(count==0 && num!= 1)
cout << num << setw(3);
}
system("pause");
return 0;
}
The Output
Enter max range: 35
2 3 5 7 11 13 17 19 23 29 31