Write about Entry controlled loop and Exit controlled loop?



Loop means, A sequence of statements are executed until some conditions for termination of the loop are satisfied.

A program loop consists of 2 segments

1. Body of the loop &
2. Control statement.

The control statement tests certain conditions & then directs the repeated execution of the statements contained in the body of the loop.

Depending on the position of the control statement in the loop, a control structure may be classified either as the entry may be classified either as the entry controlled loop or as the exit–controlled loop.

 Entry controlled loop:

 In the entry controlled loop, the control conditions are tested before the start of the loop execution. If the conditions are not satisfied, then the body of the loop will be executed. It is also known as pre–test loop.

entry controlled loop


Exit controlled loop:

In the case of an exit–controlled loop, the test is performed at the end of the body of the loop execution. If the conditions are not satisfied, then the body of the loop will not be executed. It is also known as post–test loop.

exit controlled loop



A looping process, would include the following 4 steps:

1. Setting & initialization of a condition, variables.

2. Execution of the statements in the loop.

3. Test for a specified value of the con variable for execution of the loop.

4. Incrementing or updating the con. Variable.

The test may be either to determine whether the loop has been repeated the specified no of times or to determine whether a particular con has been met.


Related

Implementing a Java Program?

Implementation of a  java  application  program involves  series of  steps. They  include 1.    Creating  ...

A Simple Java program?

class Sample public  static void main (String args[] ) {   System . out .println (“ java  is better  than  c++); } Class  declaration: The first&nb...

Explain Operator precedence in Java

Operator                                     Description             ...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item