Interviews - C# Corner

Vijay Kumari
What is Entry Controlled Loop vs Exit Controlled Loop?
By Vijay Kumari in Java onSep 16 2019
  • Rohit Gupta
    Sep, 2019 17

    Entry Controlled Loop vs Exit Controlled Loop

    • In an entry controlled loop, the test condition is checked first followed by loop body, whereas in an exit controlled loop, the loop body is executed first followed by the test condition
    • In an entry controlled loop, if the test condition is false, the loop body will not be executed, whereas in exit controlled loop, if the test condition is false, the loop body will be executed once.
    • Entry controlled loops are used when checking of test condition is mandatory before executing loop body, whereas exit controlled is used when checking of test condition is mandatory after executing.
    • For loop, Foreach loop and while loops are examples of entry controlled loops, whereas do-while loop is an example of exit controlled loop.

    For a detailed tutorial on Java Control and Loop Statements please visit https://www.c-sharpcorner.com/article/java-loops-and-control-statements/

    • 0

Most Popular Companies

Most Popular Job Functions

MOST LIKED QUESTIONS