What is the value in count after the following loop is executed?

```
int count = 0;
do {
System.out.println("Welcome to Java");
} while (count++ < 9);
System.out.println(count);
```
a. 8
b. 9
c. 10
d. 11
e. 0


c. 10
The count is initialized to 0 before the loop. The loop is executed for the first time when count is 0. (count++ < 9) increments count by 1 and uses the old count value to check if count < 9. So, the loop is executed 10 times for count from 0 to 9. Note that when count is 9, the loop body is executed and then count++ increments count to 10. The previous count value 9 < 9 is false. So the loop is finished. Now count becomes 10 after the loop exits. The correct answer is C.

Computer Science & Information Technology

You might also like to view...

In a selection sort, the first step is to move the smallest value in the array to element 0 in order to sort the array in __________ order.

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

Computer Science & Information Technology

For which of the following would polymorphism not provide a clean solution?

a. A billing program where there is a variety of client types that are billed with different fee structures. b. A maintenance log program where data for a variety of types of machines is collected and maintenance schedules are produced for each machine based on the data collected. c. A program to compute a 5% savings account interest for a variety of clients. d. An IRS program that maintains information on a variety of taxpayers and determines who to audit based on criteria for classes of taxpayers.

Computer Science & Information Technology

Word provides ________ tools that simplify the process of adding shapes and objects to a document

Fill in the blank(s) with correct word

Computer Science & Information Technology

When a router is first powered on, if the NVRAM is empty, what will occur as a first step?

A) The router will ask the user to enter setup mode. B) The router will complete IOS initialization. C) The router moves configuration into startup-config. D) The router moves configuration into running-config.

Computer Science & Information Technology