Which of the following apply to the while loop only? To the do...while loop only? To
both?
a. It is considered a conditional loop.
b. The body of the loop executes at least once.
c. The logical expression controlling the loop is evaluated before the loop is
entered.
d. The body of the loop may not execute at all.
SOLUTION
a. It is considered a conditional loop - applies to both because
both while loop and do_ while loop are conditional loops
b.The body of the loop executes at least once - This applies to
do_while loop only beacuse it mjust excecute atleast once
c. The logical expression controlling the loop is evaluated before
the loop is entered - This applies to while loop only.
d. The body of the loop may not execute at all - This applies to while loop only.
Comments
Leave a comment