Will the following program terminate?
```
int balance = 10;
while (true) {
if (balance < 9)
break;
balance = balance - 9;
}
```
a. Yes
b. No
a. Yes
Before the loop, balance is 10. The loop-continuation-condition is always true. In the first iteration, balance is reduced to 1. In the second iteration, the break statement is executed since (balance < 9) is now true. The correct answer for this question is A.
You might also like to view...
What number follows 55 in the series below?1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ____
A. 63 B. 68 C. 76 D. 89
The 8-bit Indexed color mode uses a palette of ____ colors.
a. 64 b. 128 c. 256 d. 16.7 million
The _________ property describes the first element withinnode.
Fill in the blank(s) with the appropriate word(s).
The ____________________ Tool moves individual anchor points.
Fill in the blank(s) with the appropriate word(s).