Checkpoint 7.9.1.
What does the following code print?
int x = -5;
while (x < 0) {
x = x + 1;
cout << x << " ";
}
- 5 4 3 2 1
- Notice that x is negative.
- -5 -4 -3 -2 -1
- Notice that the value of x is incremented before it is printed.
- -4 -3 -2 -1 0
- The value of x is incremented before it is printed so the first value printed is -4.