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

Loops in c++ programming language
Loops in c++ programming language Loops in c++ programming language
Types of Statements in Python Programming Language
Types of Statements in Python Programming LanguageTypes of Statements in Python Programming Language
Types of Statements in Python Programming Language
Explore Skilled
 
Looping in c language
Looping in c languageLooping in c language
Looping in c language
Infinity Tech Solutions
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in JavaJin Castor
 
Operators in java
Operators in javaOperators in java
Operators in java
Then Murugeshwari
 
10. switch case
10. switch case10. switch case
10. switch case
Way2itech
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
tanmaymodi4
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
satvirsandhu9
 
Forloop
ForloopForloop
Forloop
Dipen Vasoya
 
Java loops for, while and do...while
Java loops   for, while and do...whileJava loops   for, while and do...while
Java loops for, while and do...while
Jayfee Ramos
 
While loop
While loopWhile loop
While loop
Feras_83
 
Decision making and looping
Decision making and loopingDecision making and looping
Decision making and looping
Hossain Md Shakhawat
 
Different loops in C
Different loops in CDifferent loops in C
Different loops in C
Md. Arif Hossain
 
Looping statement
Looping statementLooping statement
Looping statementilakkiya
 
Control Flow Statements
Control Flow Statements Control Flow Statements
Control Flow Statements
Tarun Sharma
 
Jumping statements
Jumping statementsJumping statements
Jumping statementsSuneel Dogra
 
Loops
LoopsLoops
Control statements
Control statementsControl statements
Control statements
Kanwalpreet Kaur
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
AbhayDhupar
 

What's hot (20)

Loops in c++ programming language
Loops in c++ programming language Loops in c++ programming language
Loops in c++ programming language
 
Types of Statements in Python Programming Language
Types of Statements in Python Programming LanguageTypes of Statements in Python Programming Language
Types of Statements in Python Programming Language
 
Looping in c language
Looping in c languageLooping in c language
Looping in c language
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in Java
 
Loops in c
Loops in cLoops in c
Loops in c
 
Operators in java
Operators in javaOperators in java
Operators in java
 
10. switch case
10. switch case10. switch case
10. switch case
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
Forloop
ForloopForloop
Forloop
 
Java loops for, while and do...while
Java loops   for, while and do...whileJava loops   for, while and do...while
Java loops for, while and do...while
 
While loop
While loopWhile loop
While loop
 
Decision making and looping
Decision making and loopingDecision making and looping
Decision making and looping
 
Different loops in C
Different loops in CDifferent loops in C
Different loops in C
 
Looping statement
Looping statementLooping statement
Looping statement
 
Control Flow Statements
Control Flow Statements Control Flow Statements
Control Flow Statements
 
Jumping statements
Jumping statementsJumping statements
Jumping statements
 
Loops
LoopsLoops
Loops
 
Control statements
Control statementsControl statements
Control statements
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
 

Similar to Loops

Cse lecture-7-c loop
Cse lecture-7-c loopCse lecture-7-c loop
Cse lecture-7-c loop
FarshidKhan
 
Cpp loop types
Cpp loop typesCpp loop types
Cpp loop types
Rj Baculo
 
Loop structures
Loop structuresLoop structures
Loop structures
tazeem sana
 
DECISION MAKING.pptx
DECISION MAKING.pptxDECISION MAKING.pptx
DECISION MAKING.pptx
Ayshwarya Baburam
 
Loop in C Properties & Applications
Loop in C Properties & ApplicationsLoop in C Properties & Applications
Loop in C Properties & Applications
Emroz Sardar
 
R loops
R   loopsR   loops
Computer programming 2 Lesson 8
Computer programming 2  Lesson 8Computer programming 2  Lesson 8
Computer programming 2 Lesson 8
MLG College of Learning, Inc
 
LOOPING IN C- PROGRAMMING.pptx
LOOPING IN C- PROGRAMMING.pptxLOOPING IN C- PROGRAMMING.pptx
LOOPING IN C- PROGRAMMING.pptx
AFANJIPHILL
 
Fundamentals of programming
Fundamentals of programmingFundamentals of programming
Fundamentals of programmingKaycee Parcon
 
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
muhammadFaheem656405
 
Different types of loops-Prasad.ppt
Different types of loops-Prasad.pptDifferent types of loops-Prasad.ppt
Different types of loops-Prasad.ppt
DxTechGaming
 
C language 2
C language 2C language 2
C language 2
Arafat Bin Reza
 
Learn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & LoopsLearn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & Loops
Eng Teong Cheah
 
LOOPING_STATEMENT c++ pptx from bgctub university
LOOPING_STATEMENT c++ pptx from bgctub universityLOOPING_STATEMENT c++ pptx from bgctub university
LOOPING_STATEMENT c++ pptx from bgctub university
jebinchowdhury68
 
python.pptx
python.pptxpython.pptx
python.pptx
Poornima116356
 
Matlab loops 2
Matlab loops 2Matlab loops 2
Matlab loops 2
pramodkumar1804
 
Matlab loops
Matlab loopsMatlab loops
Matlab loops
pramodkumar1804
 

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
 
LOOPING_STATEMENT c++ pptx from bgctub university
LOOPING_STATEMENT c++ pptx from bgctub universityLOOPING_STATEMENT c++ pptx from bgctub university
LOOPING_STATEMENT c++ pptx from bgctub university
 
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
 

Recently uploaded

Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 

Recently uploaded (20)

Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 

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