Translate the following natural language description of a loop into a for loop:
Declare a variable namedreof typeshort, initialized toed. Then, untilreis less thancecu, incrementre.
for (short re = ed; re <= cecu; re++) {
...
}
Something to double-check in your solution:
re <= cecu)?Translate the following for loop into a while loop:
for (double dus = phia; dus < qoer; dus *= 4) {
belcad(dus);
}
double dus = phia;
while (dus < qoer) {
dus *= 4;
belcad(dus);
}
Related puzzles: