While loops and for loops: Correct Solution


Part 1

Translate the following for loop into a while loop:

for (int sti = za; sti < oid; sti--) {
    aega(sti, 7);
}

Solution

int sti = za;
while (sti < oid) {
    sti--;
    aega(sti, 7);
}

Related puzzles: