Mark the following statements as true or false: a. In a counter-controlled while
ID: 3593026 • Letter: M
Question
Mark the following statements as true or false:
a. In a counter-controlled while loop, it is not necessary to initialize the loop control variable.
b. It is possible that the body of a while loop might not execute at all.
c. In an infinite while loop, the loop condition is initially false, but after the first iteration, it is always true.
d. The while loop: terminates when j > 10.
e. A sentinel-controlled while loop is an event-controlled while loop whose termination depends on a special value.
f. A loop is a control structure that causes certain statements to execute over and over.
g. To read data from a file of an unspecified length, an EOF-controlled loop is a good choice.
h. When a while loop terminates, the control first goes back to the statement just before the while statement, and then the control goes to the statement immediately following the while loop.
Explanation / Answer
a. In a counter-controlled while loop, it is not necessary to initialize the loop control variable.
Answer: False
b. It is possible that the body of a while loop might not execute at all.
Answer: True
c. In an infinite while loop, the loop condition is initially false, but after the first iteration, it is always true.
Answer: False
d. The while loop: terminates when j > 10.
Answer: False
e. A sentinel-controlled while loop is an event-controlled while loop whose termination depends on a special value.
Answer: True
f. A loop is a control structure that causes certain statements to execute over and over.
Answer: False
g. To read data from a file of an unspecified length, an EOF-controlled loop is a good choice.
Answer: True
h. When a while loop terminates, the control first goes back to the statement just before the while statement, and then the control goes to the statement immediately following the while loop.
Answer: False
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.