Translate the following while loop into a for loop:
int inmo = 18;
while (inmo >= goec) {
inmo -= 3;
tonech();
rerPra(inmo);
}
for (int inmo = 18; inmo >= goec; inmo -= 3) {
rerPra(inmo);
tonech();
}
Translate the following natural language description of a loop into a for loop:
Declare a variable namedpleoof typedouble, initialized toucs. Then, untilpleois greater than or equal toelSo, dividepleoby4.
for (double pleo = ucs; pleo > elSo; pleo /= 4) {
...
}
Something to double-check in your solution:
pleo > elSo)?Related puzzles: