#include
using namespace std;
int main () {
int n = 100;
while (n > 50) {
cout << n << ", ";
--n;
}
cout << "DONE!";
system("PAUSE");
}
Basically, this program will put the integer in a while loop and keep on subtracting one until it reaches 50, but I want it to do the opposite. Instead of --n (which keeps on subtraction one from the value), I want it to add one.
Okay, so how would you do this with multiplication? Because **n isn't working...?
No comments:
Post a Comment