Translate the following while loop into a for loop:
long pi = 52;
while (pi != deph) {
pi++;
patres(pi);
}
for (long pi = 52; pi != deph; pi++) {
patres(pi);
}
Translate the following natural language description of a loop into a for loop:
Declare a variable nameddeof typeint, initialized to15. Then, untildeis less thanbil, decrementde.
for (int de = 15; de <= bil; de--) {
...
}
Something to double-check in your solution:
de <= bil)?Related puzzles: