Difference between entry controlled loop and exit controlled loop:
- Entry controlled loop: The condition is checked before entering the loop body, so the loop may not execute at all if the condition is false. Examples:
for, while.
- Exit controlled loop: The loop body is executed at least once, and the condition is checked after execution. Example:
do-while.