The goal is to print N to N1 in descending order. I've did this b4 but now i'm getting runtime errors..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream>
usingnamespace std;
int main() {
int i = 1, n;
int n1;
// Get number from the keyboard and initialize i.
cout << "Enter a number and press ENTER: ";
cin >> n;
cout << "enter another number and press ENTER: ";
cin >> n1;
while (n1 > n) {
cout << n1 << " " << endl;}
n1--;
system("PAUSE");
return 0;
}
You need to include <stdlib.h> for "System Pause".. also.... your program would go into an infinite loop. You need to include n1-- inside the while loop.