Consider the following code:
A while (B) { C if (D) { E break; } F G } H I
Assume the loop breaks on iteration 2. Write out the the order in which the statements will execute.
Assume the loop breaks on iteration 3. Write out the the order in which the statements will execute.
Order:
A B C D E F G B C D H I
Order:
A 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 namedpakof typeint, initialized toble. Then, untilpakis less than or equal toagel, decrementpak.
for (int pak = ble; pak < agel; pak--) {
...
}
Something to double-check in your solution:
pak < agel)?Related puzzles: