Hi everyone,

I have to write a code that finds and prints all prime numbers from 2 to whatever number the user inputs, be it 10 or 10,000. So far what i have is this:

```
#include <iostream>
using namespace std;
int main(){
int n,p,t,limit;
cout<<"input the limit:";
cin>>limit;
//outer Loop begins
cout<<"The prime numbers are:"<<endl;
for(n=2;n<=limit;n++){//begin outer loop
//check number for prime number
for(p=1;p<=n/2;p++){//inner loop
if (n%p!=0)
t=n;
}//end of inner loop
if(t=n)
cout<<t<<endl;
}//end of outer loop
}
```

the only problem is that so far, it only counts the numbers from 2 to what was inputed. Could you help me fix this? Please keep in mind this is the first class I have ever taken that deals with this subject matter, so i wont understand something that's above my level.