SlideShare a Scribd company logo
What is loop?
When a block of code needs to be executed several number of
times. In general, statements are executed sequentially: The first
statement in a function is executed first, followed by the second,
and so on.
A loop statement allows us to execute a statement or group of
statements multiple times.
Condition
Conditional Code
If condition is
False
If condition is
true
Types of loops in C-:
1. For loop
2. While loop
3. Do while loop
For loop
For loop is used to execute a set of statements repeatedly until a
particular condition is satisfied. We can say it is an open ended
loop.
Syntax: for(initialization; condition; updation)
{
//block of code
}
Example: for(i=1; i<=10; i++)
{
printf(“%d”,i);
}
Control flow in for loop:-
1. Initialization code is evaluated.
2. Condition is checked.
3. When condition is true block of for loop statements are executed.
4. After execution of statements, updation is done, again condition is
checked and so on
Let’s see an example
Control Statements
Loop control statements change execution from its normal
sequence. These statements forces the loop to perform the
execution accordingly.
1. break
2. continue
3. go to
Let’s understand these
through an example

More Related Content

PPTX
Basic for Loop in C
PPTX
PPTX
Presentation on Loop(C Language) by Dheemaan Daash
DOC
Jumping statements
PPT
Decision making and looping
PPT
Java control flow statements
PPSX
Break and continue
Basic for Loop in C
Presentation on Loop(C Language) by Dheemaan Daash
Jumping statements
Decision making and looping
Java control flow statements
Break and continue

What's hot (20)

PPTX
Java Control Statements
PPTX
Java loops for, while and do...while
DOC
Loop and storage class
PPTX
Understand Decision structures in c++ (cplusplus)
PPTX
Do...while loop structure
PDF
Lecture15 comparisonoftheloopcontrolstructures.ppt
PPTX
Looping (Computer programming and utilization)
PDF
Control statements
PPT
Java Programming: Loops
PPTX
Loops in c language
PPT
Conditional Loops Python
PPTX
PPT
M C6java5
PDF
Loops in c++
PPTX
Loops in java script
PDF
21 ruby exceptions
PDF
Java -lec-4
PDF
Control statements anil
Java Control Statements
Java loops for, while and do...while
Loop and storage class
Understand Decision structures in c++ (cplusplus)
Do...while loop structure
Lecture15 comparisonoftheloopcontrolstructures.ppt
Looping (Computer programming and utilization)
Control statements
Java Programming: Loops
Loops in c language
Conditional Loops Python
M C6java5
Loops in c++
Loops in java script
21 ruby exceptions
Java -lec-4
Control statements anil
Ad

Similar to What is loops? What is For loop? (20)

PPTX
presentation on powerpoint template.pptx
PPTX
C language 2
PPTX
Control Statement IN C.pptx
PPTX
Comp ppt (1)
DOCX
itretion.docx
PDF
Unit 2=Decision Control & Looping Statements.pdf
PPTX
DECISION MAKING AND BRANCHING - C Programming
PPTX
Cse lecture-7-c loop
PDF
Java Repetiotion Statements
PPTX
Loops In C++
PPT
Programs in C based on looping statements
PDF
whileloop-161225171903.pdf
PPT
While loop
PDF
Cpp loop types
PPTX
Loops in c
PPTX
Managing input and output operations & Decision making and branching and looping
PPTX
C Programming - Decision making, Looping
PDF
Chapter 9 - Loops in C++
DOCX
Chapter 4(1)
PDF
Unit II chapter 4 Loops in C
presentation on powerpoint template.pptx
C language 2
Control Statement IN C.pptx
Comp ppt (1)
itretion.docx
Unit 2=Decision Control & Looping Statements.pdf
DECISION MAKING AND BRANCHING - C Programming
Cse lecture-7-c loop
Java Repetiotion Statements
Loops In C++
Programs in C based on looping statements
whileloop-161225171903.pdf
While loop
Cpp loop types
Loops in c
Managing input and output operations & Decision making and branching and looping
C Programming - Decision making, Looping
Chapter 9 - Loops in C++
Chapter 4(1)
Unit II chapter 4 Loops in C
Ad

More from AnuragSrivastava272 (13)

PPTX
What is recursion?
PPTX
What is Do while loop?
PPTX
What is while loop?
PPTX
What is Switch Case?
PPTX
What are conditional statements?
PPTX
What are operators?
PPTX
What is Non-primitive data type?
PPTX
What is Data Types and Functions?
PPTX
What is Variables and Header files
PPTX
What is IDE?
PPTX
What is Platform Dependency?
PPTX
What is Computer Language?
PPTX
What is Language?
What is recursion?
What is Do while loop?
What is while loop?
What is Switch Case?
What are conditional statements?
What are operators?
What is Non-primitive data type?
What is Data Types and Functions?
What is Variables and Header files
What is IDE?
What is Platform Dependency?
What is Computer Language?
What is Language?

Recently uploaded (20)

PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Computing-Curriculum for Schools in Ghana
PDF
Pre independence Education in Inndia.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Lesson notes of climatology university.
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Abdominal Access Techniques with Prof. Dr. R K Mishra
STATICS OF THE RIGID BODIES Hibbelers.pdf
Complications of Minimal Access Surgery at WLH
102 student loan defaulters named and shamed – Is someone you know on the list?
TR - Agricultural Crops Production NC III.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Basic Mud Logging Guide for educational purpose
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Cell Structure & Organelles in detailed.
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Computing-Curriculum for Schools in Ghana
Pre independence Education in Inndia.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Renaissance Architecture: A Journey from Faith to Humanism
Lesson notes of climatology university.
O5-L3 Freight Transport Ops (International) V1.pdf
Microbial disease of the cardiovascular and lymphatic systems
PPH.pptx obstetrics and gynecology in nursing
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES

What is loops? What is For loop?

  • 2. When a block of code needs to be executed several number of times. In general, statements are executed sequentially: The first statement in a function is executed first, followed by the second, and so on. A loop statement allows us to execute a statement or group of statements multiple times.
  • 3. Condition Conditional Code If condition is False If condition is true
  • 4. Types of loops in C-: 1. For loop 2. While loop 3. Do while loop
  • 5. For loop For loop is used to execute a set of statements repeatedly until a particular condition is satisfied. We can say it is an open ended loop. Syntax: for(initialization; condition; updation) { //block of code } Example: for(i=1; i<=10; i++) { printf(“%d”,i); }
  • 6. Control flow in for loop:- 1. Initialization code is evaluated. 2. Condition is checked. 3. When condition is true block of for loop statements are executed. 4. After execution of statements, updation is done, again condition is checked and so on
  • 7. Let’s see an example
  • 8. Control Statements Loop control statements change execution from its normal sequence. These statements forces the loop to perform the execution accordingly. 1. break 2. continue 3. go to