SlideShare a Scribd company logo
1 of 17
LOOPING
Table Of Content
Types of
loop
Looping
definition
For loop
While
loop
Do while
loop
In computer programming, a loop is a sequence of
instructions that is continually repeated until a
certain condition is reached
Programming language provide various control
structures that allow for more complicated
execution paths
Loop control statement change execution from its
normal sequence. When execution leaves a scope,
all automatic objects that were created in that
scope are destroyed.
A Loop statement allows us to execute a
statement or group of statements multiple times .
Loop type Description
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 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 loop You can use one or more loop inside any
another while, for or do while loop
The syntax of a for loop in C programming language is :
In computer science a for loop is a programming language
statement which allows code to be repeatedly executed
SYNTAX
The syntax of a while loop in C programming language :
Here, statement(s) may be a single statement or a
block of statements. The condition may be any
expression, and true is any nonzero value. The loop
iterates while the condition is true.
When the condition becomes false, the program
control passes to the line immediately following the
loop.
A while loop statement in C programming language
repeatedly executes a target statement as long as a
given condition is true.
Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop
in C programming checks its condition at the bottom of the loop.
A do...while loop is similar to a while loop, except the fact that it is guaranteed to execute at least
one time.
The syntax of a do...while loop in C programming language is −
C programming allows to use one loop inside another loop. The following section shows
a few examples to illustrate the concept.
Loops
Loops
Loops

More Related Content

What's hot

Looping statement
Looping statementLooping statement
Looping statement
ilakkiya
 
3.looping(iteration statements)
3.looping(iteration statements)3.looping(iteration statements)
3.looping(iteration statements)
Hardik gupta
 
Presentation on nesting of loops
Presentation on nesting of loopsPresentation on nesting of loops
Presentation on nesting of loops
bsdeol28
 

What's hot (20)

Loops in c programming
Loops in c programmingLoops in c programming
Loops in c programming
 
Loops c++
Loops c++Loops c++
Loops c++
 
Loops in c++ programming language
Loops in c++ programming language Loops in c++ programming language
Loops in c++ programming language
 
Looping statement
Looping statementLooping statement
Looping statement
 
Conditional statement c++
Conditional statement c++Conditional statement c++
Conditional statement c++
 
python conditional statement.pptx
python conditional statement.pptxpython conditional statement.pptx
python conditional statement.pptx
 
Loops in C Programming Language
Loops in C Programming LanguageLoops in C Programming Language
Loops in C Programming Language
 
types of loops and what is loop
types of loops and what is looptypes of loops and what is loop
types of loops and what is loop
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in Java
 
Loops Basics
Loops BasicsLoops Basics
Loops Basics
 
Iteration
IterationIteration
Iteration
 
Control structures in java
Control structures in javaControl structures in java
Control structures in java
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
 
10. switch case
10. switch case10. switch case
10. switch case
 
Control statements
Control statementsControl statements
Control statements
 
3.looping(iteration statements)
3.looping(iteration statements)3.looping(iteration statements)
3.looping(iteration statements)
 
Conditional statement in c
Conditional statement in cConditional statement in c
Conditional statement in c
 
Different loops in C
Different loops in CDifferent loops in C
Different loops in C
 
Presentation on nesting of loops
Presentation on nesting of loopsPresentation on nesting of loops
Presentation on nesting of loops
 
Control statements in c
Control statements in cControl statements in c
Control statements in c
 

Similar to Loops

Fundamentals of programming
Fundamentals of programmingFundamentals of programming
Fundamentals of programming
Kaycee Parcon
 

Similar to Loops (20)

Loops
LoopsLoops
Loops
 
Cse lecture-7-c loop
Cse lecture-7-c loopCse lecture-7-c loop
Cse lecture-7-c loop
 
Cpp loop types
Cpp loop typesCpp loop types
Cpp loop types
 
Loop structures
Loop structuresLoop structures
Loop structures
 
DECISION MAKING.pptx
DECISION MAKING.pptxDECISION MAKING.pptx
DECISION MAKING.pptx
 
Loop in C Properties & Applications
Loop in C Properties & ApplicationsLoop in C Properties & Applications
Loop in C Properties & Applications
 
R loops
R   loopsR   loops
R loops
 
Python loops
Python loopsPython loops
Python loops
 
Computer programming 2 Lesson 8
Computer programming 2  Lesson 8Computer programming 2  Lesson 8
Computer programming 2 Lesson 8
 
LOOPING IN C- PROGRAMMING.pptx
LOOPING IN C- PROGRAMMING.pptxLOOPING IN C- PROGRAMMING.pptx
LOOPING IN C- PROGRAMMING.pptx
 
Fundamentals of programming
Fundamentals of programmingFundamentals of programming
Fundamentals of programming
 
2nd year computer science chapter 12 notes
2nd year computer science chapter 12 notes2nd year computer science chapter 12 notes
2nd year computer science chapter 12 notes
 
Different types of loops-Prasad.ppt
Different types of loops-Prasad.pptDifferent types of loops-Prasad.ppt
Different types of loops-Prasad.ppt
 
C language 2
C language 2C language 2
C language 2
 
Final requirement
Final requirementFinal requirement
Final requirement
 
Learn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & LoopsLearn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & Loops
 
python.pptx
python.pptxpython.pptx
python.pptx
 
Matlab loops 2
Matlab loops 2Matlab loops 2
Matlab loops 2
 
Matlab loops
Matlab loopsMatlab loops
Matlab loops
 
C loops
C loopsC loops
C loops
 

Recently uploaded

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
pritamlangde
 

Recently uploaded (20)

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth Reinforcement
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 

Loops

  • 2. Table Of Content Types of loop Looping definition For loop While loop Do while loop
  • 3. In computer programming, a loop is a sequence of instructions that is continually repeated until a certain condition is reached Programming language provide various control structures that allow for more complicated execution paths Loop control statement change execution from its normal sequence. When execution leaves a scope, all automatic objects that were created in that scope are destroyed. A Loop statement allows us to execute a statement or group of statements multiple times .
  • 4. Loop type Description 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 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 loop You can use one or more loop inside any another while, for or do while loop
  • 5. The syntax of a for loop in C programming language is : In computer science a for loop is a programming language statement which allows code to be repeatedly executed
  • 6.
  • 7.
  • 8. SYNTAX The syntax of a while loop in C programming language : Here, statement(s) may be a single statement or a block of statements. The condition may be any expression, and true is any nonzero value. The loop iterates while the condition is true. When the condition becomes false, the program control passes to the line immediately following the loop. A while loop statement in C programming language repeatedly executes a target statement as long as a given condition is true.
  • 9.
  • 10.
  • 11. Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop in C programming checks its condition at the bottom of the loop. A do...while loop is similar to a while loop, except the fact that it is guaranteed to execute at least one time. The syntax of a do...while loop in C programming language is −
  • 12.
  • 13.
  • 14. C programming allows to use one loop inside another loop. The following section shows a few examples to illustrate the concept.

Editor's Notes

  1. © Copyright PresentationGO.com – The free PowerPoint and Google Slides template library