Or it might be a problem elsewhere?
I am doing an exercise from a recommended book, in which I am trying to get the program to print all numbers from n1 to n2 .
Here is what I have come up with:
Instead of getting the increments, it simply adds 1 to n2. I have looked for an example on the accompanying CD (that came with the book), but it doesn't have a sample for the exercise.
using namespace std;
int n1, n2, i;
cout << "Please enter a number: ";
cin >> n1;
cout << "Please enter a higher number: ";
cin >> n2;
for (i = n1 ; i <= n2; i++);
cout << i << " ";
Where did I go wrong?