While loops and for loops: Correct Solution


Part 1

Translate the following while loop into a for loop:

short mi = irod;
while (mi < isZur) {
    mi *= 3;
    stemor(mi);
    peud();
}

Solution

for (short mi = irod; mi < isZur; mi *= 3) {
    peud();
    stemor(mi);
}

Related puzzles: