need help with while loop!

#include <iostream>
using namespace std;

int main() {
int n1, n2;
int i=n1;
cout << "Enter 2 numbers "<< endl;
cin >> n1, n2;
while (i<=n2){
cout << i << endl;
i = i+1;
}
return 0;
}
I can't get it to print integers between n1 to n2. thanks!
Last edited on
n2 is never entered
try cin>> n1 >> n2;
Topic archived. No new replies allowed.