- Loops in C are such block of statements that are repeatedly executed for certain number of times on the basis of specific condition.
- The statement present in the Loop body is executed repetitively until specified condition gets false as soon as condition gets false program control comes outside the loop body and the statement present immediate after the loop’s body gets executed.
- The following diagram shows the concept of loop:
- The C Language support three types of Looping Statement in C that are given below:
|while loop||Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body.|
|for loop||for loop in C Programming execute a sequence of statements multiple times and abbreviates the code that manages the loop variable.|
|do…while loop||Like a while statement, except that it tests the condition at the end of the loop body|
|nested loops||You can use one or more loop inside any another while, for or do..while loop.|