SlideShare a Scribd company logo
1 of 10
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

More Related Content

What's hot

Loops in c programming
Loops in c programmingLoops in c programming
Loops in c programmingCHANDAN KUMAR
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C ProgrammingShuvongkor Barman
 
Decision Making Statement in C ppt
Decision Making Statement in C pptDecision Making Statement in C ppt
Decision Making Statement in C pptMANJUTRIPATHI7
 
Loop(for, while, do while) condition Presentation
Loop(for, while, do while) condition PresentationLoop(for, while, do while) condition Presentation
Loop(for, while, do while) condition PresentationBadrul Alam
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language Mohamed Loey
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in JavaJin Castor
 
Conditional statement c++
Conditional statement c++Conditional statement c++
Conditional statement c++amber chaudary
 
While , For , Do-While Loop
While , For , Do-While LoopWhile , For , Do-While Loop
While , For , Do-While LoopAbhishek Choksi
 
Loops Basics
Loops BasicsLoops Basics
Loops BasicsMushiii
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT03062679929
 
Conditional statement in c
Conditional statement in cConditional statement in c
Conditional statement in cMuthuganesh S
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programmingRumman Ansari
 

What's hot (20)

Loops in c programming
Loops in c programmingLoops in c programming
Loops in c programming
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Decision Making Statement in C ppt
Decision Making Statement in C pptDecision Making Statement in C ppt
Decision Making Statement in C ppt
 
Loop(for, while, do while) condition Presentation
Loop(for, while, do while) condition PresentationLoop(for, while, do while) condition Presentation
Loop(for, while, do while) condition Presentation
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language
 
Control statements
Control statementsControl statements
Control statements
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in Java
 
Introduction to c++ ppt
Introduction to c++ pptIntroduction to c++ ppt
Introduction to c++ ppt
 
The Loops
The LoopsThe Loops
The Loops
 
Conditional statement c++
Conditional statement c++Conditional statement c++
Conditional statement c++
 
Decision making and looping
Decision making and loopingDecision making and looping
Decision making and looping
 
Looping in c language
Looping in c languageLooping in c language
Looping in c language
 
While , For , Do-While Loop
While , For , Do-While LoopWhile , For , Do-While Loop
While , For , Do-While Loop
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
 
Loops Basics
Loops BasicsLoops Basics
Loops Basics
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
 
Conditional statement in c
Conditional statement in cConditional statement in c
Conditional statement in c
 
Function in C program
Function in C programFunction in C program
Function in C program
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programming
 

Viewers also liked

Viewers also liked (8)

4.arrays
4.arrays4.arrays
4.arrays
 
5.functions
5.functions5.functions
5.functions
 
1.getting started with c
1.getting started with c1.getting started with c
1.getting started with c
 
2.decision making
2.decision making2.decision making
2.decision making
 
8.derived data types
8.derived data types8.derived data types
8.derived data types
 
6.operators
6.operators6.operators
6.operators
 
7.pointers
7.pointers7.pointers
7.pointers
 
Programming & Data Structure Lecture Notes
Programming & Data Structure Lecture NotesProgramming & Data Structure Lecture Notes
Programming & Data Structure Lecture Notes
 

Similar to 3.looping(iteration statements)

Similar to 3.looping(iteration statements) (20)

Loops in c++
Loops in c++Loops in c++
Loops in c++
 
Java Repetiotion Statements
Java Repetiotion StatementsJava Repetiotion Statements
Java Repetiotion Statements
 
Loops In C++
Loops In C++Loops In C++
Loops In C++
 
Loop
LoopLoop
Loop
 
loops and iteration.docx
loops and iteration.docxloops and iteration.docx
loops and iteration.docx
 
What is loops? What is For loop?
What is loops? What is For loop?What is loops? What is For loop?
What is loops? What is For loop?
 
cpu.pdf
cpu.pdfcpu.pdf
cpu.pdf
 
C language 2
C language 2C language 2
C language 2
 
Flow of control C ++ By TANUJ
Flow of control C ++ By TANUJFlow of control C ++ By TANUJ
Flow of control C ++ By TANUJ
 
C Programming - Decision making, Looping
C  Programming - Decision making, LoopingC  Programming - Decision making, Looping
C Programming - Decision making, Looping
 
Decision making and loop in C#
Decision making and loop in C#Decision making and loop in C#
Decision making and loop in C#
 
Programming Fundamentals in C++ structures
Programming Fundamentals in  C++ structuresProgramming Fundamentals in  C++ structures
Programming Fundamentals in C++ structures
 
Loop structures
Loop structuresLoop structures
Loop structures
 
itretion.docx
itretion.docxitretion.docx
itretion.docx
 
M C6java6
M C6java6M C6java6
M C6java6
 
Deeksha gopaliya
Deeksha gopaliyaDeeksha gopaliya
Deeksha gopaliya
 
While loop,Do While loop ,for loop
While loop,Do While loop ,for loop While loop,Do While loop ,for loop
While loop,Do While loop ,for loop
 
whileloop-161225171903.pdf
whileloop-161225171903.pdfwhileloop-161225171903.pdf
whileloop-161225171903.pdf
 
Loops in C.pptx
Loops in C.pptxLoops in C.pptx
Loops in C.pptx
 
Loops and iteration.docx
Loops and iteration.docxLoops and iteration.docx
Loops and iteration.docx
 

3.looping(iteration statements)