Translate the following natural language description of a loop into a for loop:
Declare a variable namedqeciof typeint, initialized toa. Then, untilqeciis greater than or equal toveth, decrementqeci.
for (int qeci = a; qeci > veth; qeci--) {
...
}
Something to double-check in your solution:
qeci > veth)?Translate the following while loop into a for loop:
int ke = ac;
while (ke < ukSlame) {
ke -= 4;
reoOrph(ke);
}
for (int ke = ac; ke < ukSlame; ke -= 4) {
reoOrph(ke);
}
Consider the following code:
A B while (C) { D } E F G
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 E F G
Order:
A B C D C D E F G
Related puzzles: