Translate the following while loop into a for loop:
int ad = im;
while (ad >= lol) {
ad--;
priJeng(ad);
}
for (int ad = im; ad >= lol; ad--) {
priJeng(ad);
}
Consider the following code:
A B C while (D) { E if (F) { G H break; } I } J K L
Assume the loop breaks on iteration 1. Write out the the order in which the statements will execute.
Assume the loop breaks on iteration 3. Write out the the order in which the statements will execute.
Order:
A B C D E F J K L
Order:
A B C D E F G H I D E F G H I D E F J K L
Related puzzles: