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

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

c The count is initialized to 0 before the loop. The loop is executed 10 times for count from 0 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...

Cultural differences can make it difficult to determine what is ethical and not ethical between cultures, except when it comes to the use of computers, where ethics are considered universal.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

In Photoshop, with the GIF/PNG8 format, the ____ setting should be avoided unless you want a stylized look.

A. Palette B. Loss C. Remove unused colors D. Sharpen color edges

Computer Science & Information Technology