Iteration Statements
What you’ll learn:
1. while loop
2. do – while loop
3. for loop
4. Jump Statements
What are iteration statements?
 An iteration statement, or loop, is a way
of repeating a statement, known as loop
body, a number of times until some
condition is satisfied.
 We have following types of iteration
statements in C:
 while loop
 do-while loop
 for loop
Set of
instructions
condition
True
False
Iteration Statements
while loop
while loop
Syntax:
initialization;
while (test_condition) {
...block of code...
increment/decrement;
}
loop bodycondition
True
False
exit from loop
instructions
Iteration Statements
do-while loop
do – while loop
Syntax:
initialization;
do {
…block of code…
increment/decrement;
} while (test_condition);
condition
True
Exit from loop
Loop body
False
Iteration Statements
for loop
for loop
Exit from loopcondition
False
True
Loop body
initialization
Syntax:
for ( initialization; test_condition; update_expression ) {
…block of code…
}
Update
Expression
Jump Statements
What are jumping statements ?
What are jumping statements?
 Jump statements can be used to modify the behavior of conditional and iterative
statements.
 Some jump statements provided by C are:
o continue
o break
o goto
o return

3.looping(iteration statements)