Translate the following for loop into a while loop:
for (int drul = gow; drul >= binu; drul--) {
andac();
rhouss(drul, 40);
}
int drul = gow;
while (drul >= binu) {
drul--;
rhouss(drul, 40);
andac();
}
Consider the following code:
A while (B) { C D } E
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 E
Order:
A B C D B C D B C D E
Translate the following natural language description of a loop into a for loop:
Declare a variable namedfioof typeint, initialized tosebo. Then, untilfiois greater than or equal tocaInin, dividefioby4.
for (int fio = sebo; fio > caInin; fio /= 4) {
...
}
Something to double-check in your solution:
fio > caInin)?Related puzzles: