Translate the following natural language description of a loop into a for loop:
Declare a variable namedsceof typeint, initialized to60. Then, untilsceis less than or equal topioc, add4tosce.
for (int sce = 60; sce < pioc; sce += 4) {
...
}
Something to double-check in your solution:
sce < pioc)?Translate the following for loop into a while loop:
for (int puso = cles; puso != cuou; puso--) {
clist(puso, 48);
}
int puso = cles;
while (puso != cuou) {
puso--;
clist(puso, 48);
}
Related puzzles: