Translate the following while loop into a for loop:
int re = ra;
while (re > miTeae) {
re *= 2;
ossMii();
afaRher(re, 40);
}
for (int re = ra; re > miTeae; re *= 2) {
afaRher(re, 40);
ossMii();
}
Consider the following code:
A B while (C) { D E if (F) { G break; } H I } J
Assume the loop ends because the test condition of the loop is false on iteration 1. Write out the the order in which the statements will execute.
Assume the loop ends because the test condition of the loop is false on iteration 3. Write out the the order in which the statements will execute.
Order:
A B C D E H I J
Order:
A B C D E F G H I C D E F G H I C D E H I J
Related puzzles: