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...

calculate the number of elements in lists.

(A) Sentinels (B) Counter variables (C) Accumulators (D) Nested loops

Computer Science & Information Technology

The final round of both encryption and decryption of the AES structure consists of __________ stages.

A. one B. two C. three D. four

Computer Science & Information Technology