KnowledgeBoat Logo

Computer Science

Distinguish between:

Exit controlled loop and Entry controlled loop

Java Iterative Stmts

21 Likes

Answer

Exit controlled loopEntry controlled loop
It checks the condition after executing its body. If the condition is true, loop will perform the next iteration otherwise program control will move out of the loop.It checks the condition at the time of entry. Only if the condition is true, the program control enters the body of the loop.
The loop executes at least once even if the condition is false.Loop does not execute at all if the condition is false.
Example: do-while loopExample: for and while loops

Answered By

11 Likes


Related Questions