While loops and for loops: Correct Solution


Part 1

Translate the following for loop into a while loop:

for (double te = 60; te <= riLup; te -= 2) {
    enec(te);
}

Solution

double te = 60;
while (te <= riLup) {
    te -= 2;
    enec(te);
}

Related puzzles: