LOOPS /REPETITIONS/ITERATIONS
A loop can be defined as the repition of the statements until the condition got fulfilled.Looping is consisted of statements that are executed until some condition for termination of a loop.
A program loop normally cosists of 2 segment:-
* Control Statement
* Body of the loop
The control statement test the condition and then direct the repeted execution of the statement contained in the body of the loop.
The body of the loop consists of the program statement that are given by the programmer....
The looping process in general performs the following 4 steps:---
* Setting and Initialization of the counter.
* Execution of the statement in the loop.
* Checking of the condition to run the loop for specific period of time.
* Incrementing the counter.
The C++ provides three loop constructs for performing loop operations. They are:
*
* The while statement.
* The do while statement.
* The for statement.
No comments:
Post a Comment