In this tutorial you you will be familiarize with the iteration statement which are are available for C programming language.
Iteration statement
Iteration statement is defined as the set of instructions that are repeated in a sequence for specific number of times until the condition is satisfied.
When the first set of instructions is executed again, it is called an iteration.
Iteration statements are commonly known as loops.
Also the repetition or iteration processes in C programming language is done by using loop control instruction.
There are three types of looping statements which are given below:
- For Loop
- While Loop
- Do-while loop
1. For Loop:
Syntax of for loop:
for (initialisation of variable; condition ; decrement or increment) { statement; // or {block of statements} }
2. while statement
The while statement is also known as entry control loop as it first checks the condition then inner body is compiled and executed.
The while has the following syntax:
while (expression) { statement; // or {block of statements} }
3. do-while statement
The do-while statement is also known as exit control loop as it first compiles and executes checks the inner body then condition is checked .
The do-while statement has the following syntax:
do { statement; } while (expression);
This is all about the iteration statement which are are available for C programming language. If you have any query please comment below.