In looping, the sequence of statements is executed by a program several times until the specified condition gets wrong. A loop is composed of two parts, a loop body and a control statement. The control statement is a combination of certain conditions that order the loop's body to execute until the condition stated becomes false.
A loop is divided into two groups, depending on the position of a control statement within a program:
1. Entry controlled loop
2. Exit controlled loop
Entry controlled loop
A state is verified in an input managed loop before the body of a loop is executed. It is also known as a pre-check loop.
Exit controlled loop
Once the body of a loop is executed, a condition is checked in an escape controlled loop. It is also known as a post-check loop.
The control conditions must be well defined and defined otherwise an infinite number of times will be performed on the loop. The loop that doesn't avoid running and executes the number of times statements is known as an infinite loop.The infinite loop is also referred to as an "Infinite loop" or "Endless Loop."
Some features of an infinite loop follow here:
Some features of an infinite loop follow here:
1.No requirement for termination has been defined.
2.Never meet specified conditions.
The condition given dictates whether or not to execute the body of the loop.
Continue with Loops in Next Chapter Click Here...
Continue with Loops in Next Chapter Click Here...