Repetitive(Looping) control structure in C++ : Loops in C++

 

Repetitive(Looping) control structure in C++  : Loops in C++

Repetitive(Looping) control structure:

  • In programming languages while coding a program, sometimes it is necessary to repeat a set of statements several times.
  • A way to repeat statements is to type the same statements in the program over and over.
  • The better way is to use looping control structure.
  • A loop is a mechanism that enables you to execute a statement or block of statements repeatedly until a particular condition is met.

Body of the loop.

The statement or block of statements that is to be executed repeatedly forms the so-called body of the loop.

And a loop condition of some kind that determines when to stop repeating the loop.

The process of performing the same task over and over again is called iteration.

There are three looping structures in C++:

1. while loop 

2. for loop 

3. do...while Loop 

Post a Comment

0 Comments