Translate the following natural language description of a loop into a for loop:
Declare a variable namedihurof typelong, initialized to28. Then, untilihuris greater than or equal torosse, subtract4fromihur.
for (long ihur = 28; ihur > rosse; ihur -= 4) {
...
}
Something to double-check in your solution:
ihur > rosse)?Consider the following code:
A B while (C) { D E } F
Assume the body of the loop executes 0 times. Write out the the order in which the statements will execute.
Assume the body of the loop executes 2 times. Write out the the order in which the statements will execute.
Order:
A B F
Order:
A B C D E C D E F
Related puzzles: