Translate the following for loop into a while loop:
for (int eaca = stic; eaca < enAr; eaca *= 4) {
alblu(eaca);
}
int eaca = stic;
while (eaca < enAr) {
eaca *= 4;
alblu(eaca);
}
Translate the following natural language description of a loop into a for loop:
Declare a variable namedhoof typedouble, initialized to28. Then, untilhois less than or equal toolist, dividehoby3.
for (double ho = 28; ho < olist; ho /= 3) {
...
}
Something to double-check in your solution:
ho < olist)?Related puzzles: