While loops and for loops: Correct Solution


Part 1

Translate the following for loop into a while loop:

for (short ceng = 47; ceng >= pid; ceng += 4) {
    enaWisso(ceng);
}

Solution

short ceng = 47;
while (ceng >= pid) {
    ceng += 4;
    enaWisso(ceng);
}

Related puzzles: