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.
You might also like to view...
What are the three different methods for performing a loop in C++?
What will be an ideal response?
In the 1970s and 1980s, what was an early roadblock to concurrent programming?
a) Early operating systems did not allow several programs to execute concurrently. b) Early computers were too slow to permit concurrency. c) Early programming languages did not include primitives enabling programmers to write concurrent programs. d) all of the above
____________________ is the time it takes for networked information to travel from the transmitting device to the receiving device.
Fill in the blank(s) with the appropriate word(s).
To completely remove all filters so that they cannot be toggled on/off, a user can select ________ from the Sort and Filter group and then click Clear All Filters
Fill in the blank(s) with correct word