What balance after the following code is executed?

```
int balance = 10;

while (balance >= 1) {
if (balance < 9)
continue;
balance = balance - 9;
}
```
A. -1
B. 0
C. 1
D. 2
E. The loop does not end


E. The loop does not end
Before the loop, balance is 10. The loop-continuation-condition is true (10 >= 1). In the first iteration, balance is reduced to 1. Since 1 >= 1 is true, the loop body is executed. Since balance < 9 is true, the continue statement is executed to skip the rest statement in the iteration. balance continues to be 1 and the continue statement is executed to skip the rest statement in the iteration. So the loop runs infinitely. So the correct answer to this question is E.

Computer Science & Information Technology

You might also like to view...

Revisit the Internet architecture. What impact does the introduction of overlay networks have on this architecture, and in particular on the programmer’s conceptual view of the Internet?

What will be an ideal response?

Computer Science & Information Technology

? In the figure above, item ____ points to code used to create a bullet.

A. 1 B. 2 C. 3 D. 4

Computer Science & Information Technology

Flash stores and organizes symbols in the____________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Motherboards may contain which of the following ports on the I/O panel?

A. Multiple USB ports B. PS/2 mouse and keyboard ports C. RJ-45 LAN port D. Video ports (HDMI, DVI, or DisplayPort) E. All of these

Computer Science & Information Technology