Question:

Differentiate between Entry controlled loop and Exit controlled loop.

Show Hint

Use entry-controlled loops when condition check is needed before execution; use exit-controlled when execution must happen at least once.
Updated On: Jul 14, 2025
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Loops are control structures used in programming to execute a block of code repeatedly.
Based on the condition check position, loops are classified as:
(i) Entry Controlled Loop:
In this type of loop, the condition is checked before the execution of the loop body.
The loop body is executed only if the condition is true.
Examples: for loop and while loop.
If the condition is false at the start, the loop body may not execute at all.
(ii) Exit Controlled Loop:
In this loop, the condition is checked after the loop body is executed.
Hence, the loop body is executed at least once, even if the condition is false.
Example: do-while loop.
Key Difference: Entry controlled loops check the condition first, whereas exit controlled loops check it after one execution of the body.
Was this answer helpful?
0
0