Translate the following for loop into a while loop:
for (short od = ang; od >= sqask; od *= 4) {
huntec(od);
hosHinjor();
}
short od = ang;
while (od >= sqask) {
od *= 4;
hosHinjor();
huntec(od);
}
Consider the following code:
A B C while (D) { E if (F) { G break; } H } I J
Assume the loop ends because the test condition of the loop is false on iteration 2. 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 4. Write out the the order in which the statements will execute.
Order:
A B C D E F G H D E H I J
Order:
A B C D E F G H D E F G H D E F G H D E H I J
Related puzzles: