While loops and for loops: Correct Solution


Part 1

Translate the following while loop into a for loop:

double pi = 69;
while (pi != ceDacir) {
    pi--;
    umre(pi);
}

Solution

for (double pi = 69; pi != ceDacir; pi--) {
    umre(pi);
}

Related puzzles: