While loops and for loops: Correct Solution


Part 1

Translate the following while loop into a for loop:

long di = ent;
while (di <= whest) {
    di /= 3;
    crered();
    qanUspae(di);
}

Solution

for (long di = ent; di <= whest; di /= 3) {
    qanUspae(di);
    crered();
}

Related puzzles: