Question: QUESTION 1 The following are Java loop control structures: __________________________. a. while loops b. do-while loops c. for loops d. all of the above 1
QUESTION 1
The following are Java loop control structures: __________________________.
| a. | while loops | |
| b. | do-while loops | |
| c. | for loops | |
| d. | all of the above |
1 points
QUESTION 2
Consider the following code fragment:
for (int i=5; i<=7; ++i) { System.out.println(i); }
The code will print:
| a. | 5 6 7 | |
| b. | 6 | |
| c. | 5 6 | |
| d. | 6 7 |
1 points
QUESTION 3
A do-while loop always executes _____________________.
| a. | zero or more times | |
| b. | one or more times | |
| c. | infinitely | |
| d. | in reverse order |
1 points
QUESTION 4
Consider the following code fragment:
for (int i=0; i<10; ++i) { for (int j=0; j<10; ++j) { System.out.println("Hello"); } }
How many times does the code fragment print the word "Hello"?
| a. | Once | |
| b. | 10 times | |
| c. | 100 times | |
| d. | 1000 times |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
