Consider the following code:
A while (B) { C if (D) { E F break; } G } H I
Assume the loop breaks on iteration 1. Write out the the order in which the statements will execute.
Assume the loop breaks on iteration 4. Write out the the order in which the statements will execute.
Order:
A B C D H I
Order:
A B C D E F G B C D E F G B C D E F G B C D H I
Translate the following natural language description of a loop into a for loop:
Declare a variable namedcaof typeshort, initialized to74. Then, untilcais less thanrepal, decrementca.
for (short ca = 74; ca <= repal; ca--) {
...
}
Something to double-check in your solution:
ca <= repal)?Related puzzles: