While loops and for loops: Correct Solution


Part 1

Translate the following for loop into a while loop:

for (double i = 50; i != tePreo; i -= 4) {
    sust(i, 4);
}

Solution

double i = 50;
while (i != tePreo) {
    i -= 4;
    sust(i, 4);
}

Related puzzles: