Translate the following natural language description of a loop into a for loop:
Declare a variable namediof typeshort, initialized to57. Then, untiliis greater thanrhee, multiplyiby4.
for (short i = 57; i >= rhee; i *= 4) {
...
}
Something to double-check in your solution:
i >= rhee)?Consider the following code:
A B C while (D) { E F if (G) { H break; } I } J K
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 H I D E F G J K
Order:
A B C D E F G H I D E F G H I D E F G J K
Related puzzles: