Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

when creating a definite loop, you should ensure that within the loops …

Question

when creating a definite loop, you should ensure that within the loops body the loop control variable is
a. reassigned, incremented, or decremented
b. compared with a sentinel value
c. not used as a counter for the loop
d. altered by each statement

Explanation:

Brief Explanations

In a definite loop, the loop - control variable must change (be reassigned, incremented, or decremented) within the loop body to ensure the loop terminates. Comparing with a sentinel value is for indefinite loops. It is often used as a counter, and it doesn't need to be altered by each statement.

Answer:

a. reassigned, incremented, or decremented