Answer:
#include <iostream>
using namespace std;
int main()
{
int x;
cout << "Please type your number:" << endl;
cin >> x;
int e = 1;
int i;
while(e < x+1){
bool isPrime = true;
// 0 and 1 are not prime numbers
if (e == 0 || e == 1) {
isPrime = false;
}
else {
for (i = 2; i <= e / 2; ++i) {
if (e % i == 0) {
isPrime = false;
break;
}
}
}
if (isPrime){
cout << e << endl;
}
else{
}
e++;
}
return 0;
}