Differentiate entry control and exit control loop.

 

Difference between Entry control loop and Exit control loop:


Basic Of Comparision

Entry Controlled Loop

Exit Controlled Loop

Description

Entry controlled loop is a loop in which the test condition is checked first, and then the loop body will be executed.

Exit controlled loop is a loop in which the loop body is executed first and then the given condition is checked afterward.

False Test Condition

If the test condition is false, the loop body will not be executed.

If the test condition is false, the loop body will be executed at least once.

Example

Examples of entry-controlled loops include, for loop and while loop.

An example of an exit controlled loop is do…while Loop.

Use

Entry controlled loops are used when checking of test condition is mandatory before executing the loop body.

Entry controlled loop is used when checking of test condition is mandatory after executing.



Drafted on 🌏 by,

Jal


peace

Comments

Popular posts from this blog

C program to read and display book information using structure

Count positive, negative and zero values in an array

Maximum value from array