How many times will the following code print "Welcome to Java"?

```
int count = 0;
while (count < 10) {
System.out.println("Welcome to Java");
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 10 times for count from 1 to 9. When count is 10, the loop continuation condition becomes false. The loop is finished. So, the correct answer is C.

Computer Science & Information Technology

You might also like to view...

A good reason to pass a structure as a constant reference is

a. to prevent changes to the structure's members b. to ensure changes to the structure's members c. to slow down the function's execution which helps prevent errors d. to speed up the function's modification of the structure's members e. None of these

Computer Science & Information Technology

What are the typical core/cladding sizes (in microns) for multimode fiber?

What will be an ideal response?

Computer Science & Information Technology

On what do deontological theorists focus?

What will be an ideal response?

Computer Science & Information Technology

A(n) ________ Table query can create a new table based on data in an existing table

Fill in the blank(s) with correct word

Computer Science & Information Technology