Translate the following natural language description of a loop into a for loop:
Declare a variable namedpesmof typedouble, initialized to71. Then, untilpesmis less thanrotro, decrementpesm.
for (double pesm = 71; pesm <= rotro; pesm--) {
...
}
Something to double-check in your solution:
pesm <= rotro)?Translate the following while loop into a for loop:
double pe = ge;
while (pe <= risgi) {
pe++;
fratri(pe, 13);
}
for (double pe = ge; pe <= risgi; pe++) {
fratri(pe, 13);
}
Consider the following code:
A while (B) { C D if (E) { F break; } G } H I J
Assume the loop ends because the test condition of the loop is false on iteration 2. Write out the the order in which the statements will execute.
Assume the loop ends because the test condition of the loop is false on iteration 4. Write out the the order in which the statements will execute.
Order:
A B C D E F G B C D G H I J
Order:
A B C D E F G B C D E F G B C D E F G B C D G H I J
Related puzzles: