While loops and for loops: Correct Solution


Part 1

Translate the following for loop into a while loop:

for (short ba = 8; ba >= depro; ba -= 4) {
    engfir();
    sestal(ba, 35);
}

Solution

short ba = 8;
while (ba >= depro) {
    ba -= 4;
    sestal(ba, 35);
    engfir();
}

Related puzzles: