What is sum after the following loop terminates?

```
int sum = 0;
int item = 0;
do
{
item++;
sum += item;
if (sum > 4) break;
}
while (item < 5);
```

A. 7
B. 8
C. 6
D. 5

C. 6

Computer Science & Information Technology

You might also like to view...

The minimum RAM required for Windows 7 is ________

a. 1 GB b. 4 GB c. 1 GB (32-bit) or 2 GB (64-bit) d. 8 GB

Computer Science & Information Technology

In an activity diagram for an algorithm, what does a solid circle surrounded by a hollow circle represent?

a. Initial state. b. Final state. c. Action state. d. Transition.

Computer Science & Information Technology