Translate the following natural language description of a loop into a for loop:
Declare a variable namedwiof typedouble, initialized to83. Then, untilwiis greater than or equal tomoct, decrementwi.
for (double wi = 83; wi > moct; wi--) {
...
}
Something to double-check in your solution:
wi > moct)?Consider the following code:
A for (B; C; D) { E F } G H
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 3 times. Write out the the order in which the statements will execute.
Order:
A B D G H
Order:
A B C D E F C D E F C D E F D G H
Related puzzles: