SlideShare a Scribd company logo
PRESANTATION ON
“Looping control structure”
GUPTA HARSH
13ME030
Introduction of loop
• A loop is a programming structure that allows
an action to repeat until the program meets a
given condition.
• After each iteration of a loop, the loop checks
against a loop control expression to see if the
program met a the given condition. If it did,
the loop stops. If not, the loop moves on to
the next iteration.
CONTINUE…
• Loop: a control structure that repeats a group
of steps in a program
• C loop control statements
• Two types of control statement….. They are:-
Exit control loop and
Entry control loop
Exit Control loop
• In exit control loop, the
body is executed first and
then the condition is
checked.
• In exit control loop the
body is executed
at least once.
Entry Control loop
• In entry control loop,
the condition is checked
first and then body is
executed.
• In Entry control loop
the body is not
executed at all if the
condition is false.
Looping…
• ‘C’ language provides following looping
structures:-
1. WHILE
2. DO-WHILE
3. FOR
WHILE LOOP
– Of the three different loop structures offered in C, while-
loops are conceptually the simplest.
– Resembles if-statement, but does not have an else.
– Conceptually, keep executing the loop body again and
again till the condition is true.
– Loop terminates when the loop condition becomes false.
– Note that the truth of the loop condition is not checked
constantly between every statement in the loop body, but
only at the beginning of the loop, and then again between
the repetitions of the loop body
– Condition may be temporarily false during the loop, but
become true again before it is checked
DO-WHILE LOOP
– The second type of loop offered in C is the do-while.
– Clearly the least commonly used of the three: one famous
study of real world programs revealed that out of all loops
in them, only 1% are do-while.
– Do-while behaves exactly the same way as the while-loop,
but is guaranteed to execute its body at least once before
it starts looking at the loop condition.
– The possibility of executing the loop body zero times
does not exist, even if the condition is initially false
– do-while is most useful in situations where testing
the condition simply does not make any sense until
the loop body has been executed once
FOR LOOP
– The third type of loop structure in C is suitable for
the common task of iterating through the values of
a range of integers, one value at the time.
– For example, go through the numbers from 1 to 100.
– The for-loop header defines this range, and the loop
body contains the statements you execute for each
value.
– To define an integer range, you need to define three
things: where it begins (1), where it ends (100), and
the step size between the consecutive values of the
range (1)
CONTINUE…
– It is not a coincidence that the header of a for-loop
consists of three parts, for the three things that
define a range.
– We can still use while like in countdown, but using a
for-loop makes it clear that we are going through a
range.
– It is not a coincidence that the header of a for-loop
consists of three parts, for the three things that
define a range.
– We can still use while like in countdown, but using a
for-loop makes it clear that we are going through a
range.
Flowchart of FOR LOOP
for( initializing list;condition; updation)
BREAK STATEMENT
• Remember the break keyword that we used
to stop a switch statement from executing
more than one statement?
• break can also be used to exit an infinite
loop
• But it is almost always best to use a well-
written while loop.
CONTINUE STATEMENT
– Continue is a statement similar to break, but
instead of jumping out of the loop altogether, it
jumps to the next round of the loop, skipping the
rest of the body
– Most commonly used to skip some of the values
inside the range for which the loop doesn't need
to do anything
Introduction to loops  cpu

More Related Content

What's hot

Types of loops in c language
Types of loops in c languageTypes of loops in c language
Types of loops in c language
sneha2494
 
Java loops
Java loopsJava loops
Java loops
ricardovigan
 
Programming loop
Programming loopProgramming loop
Programming loop
University of Potsdam
 
Java input Scanner
Java input Scanner Java input Scanner
Java input Scanner
Huda Alameen
 
Chap 6(decision making-looping)
Chap 6(decision making-looping)Chap 6(decision making-looping)
Java Repetiotion Statements
Java Repetiotion StatementsJava Repetiotion Statements
Java Repetiotion Statements
Huda Alameen
 
Loops c++
Loops c++Loops c++
Loops c++
Shivani Singh
 
Loops in C Programming | for Loop | do-while Loop | while Loop | Nested Loop
Loops in C Programming | for Loop | do-while Loop | while Loop | Nested LoopLoops in C Programming | for Loop | do-while Loop | while Loop | Nested Loop
Loops in C Programming | for Loop | do-while Loop | while Loop | Nested Loop
Priyom Majumder
 
loops and iteration.docx
loops and iteration.docxloops and iteration.docx
loops and iteration.docx
JavvajiVenkat
 
Forloop
ForloopForloop
Forloop
Dipen Vasoya
 
While loops
While loopsWhile loops
While loops
Michael Gordon
 
The Loops
The LoopsThe Loops
The Loops
Krishma Parekh
 
Decision making and looping
Decision making and loopingDecision making and looping
Decision making and looping
Hossain Md Shakhawat
 
Loop (Computer programming and utilization)
Loop (Computer programming and utilization)Loop (Computer programming and utilization)
Loop (Computer programming and utilization)
Digvijaysinh Gohil
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
tanmaymodi4
 
Looping in c++
Looping in c++Looping in c++
Looping in c++
deekshagopaliya
 
Presentation on Loop(C Language) by Dheemaan Daash
Presentation on Loop(C Language)  by Dheemaan DaashPresentation on Loop(C Language)  by Dheemaan Daash
Presentation on Loop(C Language) by Dheemaan Daash
Dheemaan Daash
 
Loops
LoopsLoops
Looping
LoopingLooping
Control structures in c++
Control structures in c++Control structures in c++
Control structures in c++
Nitin Jawla
 

What's hot (20)

Types of loops in c language
Types of loops in c languageTypes of loops in c language
Types of loops in c language
 
Java loops
Java loopsJava loops
Java loops
 
Programming loop
Programming loopProgramming loop
Programming loop
 
Java input Scanner
Java input Scanner Java input Scanner
Java input Scanner
 
Chap 6(decision making-looping)
Chap 6(decision making-looping)Chap 6(decision making-looping)
Chap 6(decision making-looping)
 
Java Repetiotion Statements
Java Repetiotion StatementsJava Repetiotion Statements
Java Repetiotion Statements
 
Loops c++
Loops c++Loops c++
Loops c++
 
Loops in C Programming | for Loop | do-while Loop | while Loop | Nested Loop
Loops in C Programming | for Loop | do-while Loop | while Loop | Nested LoopLoops in C Programming | for Loop | do-while Loop | while Loop | Nested Loop
Loops in C Programming | for Loop | do-while Loop | while Loop | Nested Loop
 
loops and iteration.docx
loops and iteration.docxloops and iteration.docx
loops and iteration.docx
 
Forloop
ForloopForloop
Forloop
 
While loops
While loopsWhile loops
While loops
 
The Loops
The LoopsThe Loops
The Loops
 
Decision making and looping
Decision making and loopingDecision making and looping
Decision making and looping
 
Loop (Computer programming and utilization)
Loop (Computer programming and utilization)Loop (Computer programming and utilization)
Loop (Computer programming and utilization)
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
 
Looping in c++
Looping in c++Looping in c++
Looping in c++
 
Presentation on Loop(C Language) by Dheemaan Daash
Presentation on Loop(C Language)  by Dheemaan DaashPresentation on Loop(C Language)  by Dheemaan Daash
Presentation on Loop(C Language) by Dheemaan Daash
 
Loops
LoopsLoops
Loops
 
Looping
LoopingLooping
Looping
 
Control structures in c++
Control structures in c++Control structures in c++
Control structures in c++
 

Similar to Introduction to loops cpu

Cse lecture-7-c loop
Cse lecture-7-c loopCse lecture-7-c loop
Cse lecture-7-c loop
FarshidKhan
 
Loop in C Properties & Applications
Loop in C Properties & ApplicationsLoop in C Properties & Applications
Loop in C Properties & Applications
Emroz Sardar
 
C language 2
C language 2C language 2
C language 2
Arafat Bin Reza
 
Cpp loop types
Cpp loop typesCpp loop types
Cpp loop types
Rj Baculo
 
Loop
LoopLoop
Loops
LoopsLoops
C language (Part 2)
C language (Part 2)C language (Part 2)
C language (Part 2)
SURBHI SAROHA
 
Loop structures
Loop structuresLoop structures
Loop structures
tazeem sana
 
Chapter 9 - Loops in C++
Chapter 9 - Loops in C++Chapter 9 - Loops in C++
Chapter 9 - Loops in C++
Deepak Singh
 
Unit II chapter 4 Loops in C
Unit II chapter 4 Loops in CUnit II chapter 4 Loops in C
Unit II chapter 4 Loops in C
Sowmya Jyothi
 
Igdpd c21 loops
Igdpd c21 loopsIgdpd c21 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
 
Control structures repetition
Control structures   repetitionControl structures   repetition
Control structures repetition
Online
 
Loops In C++
Loops In C++Loops In C++
Loops In C++
Banasthali Vidyapith
 
whileloop-161225171903.pdf
whileloop-161225171903.pdfwhileloop-161225171903.pdf
whileloop-161225171903.pdf
BasirKhan21
 
While loop
While loopWhile loop
While loop
Feras_83
 
C Programming - Decision making, Looping
C  Programming - Decision making, LoopingC  Programming - Decision making, Looping
C Programming - Decision making, Looping
MURALIDHAR R
 
Loops in c programming
Loops in c programmingLoops in c programming
Loops in c programming
CHANDAN KUMAR
 
Loops in c++
Loops in c++Loops in c++
Loops in c++
Rebin Daho
 
Loops
LoopsLoops

Similar to Introduction to loops cpu (20)

Cse lecture-7-c loop
Cse lecture-7-c loopCse lecture-7-c loop
Cse lecture-7-c loop
 
Loop in C Properties & Applications
Loop in C Properties & ApplicationsLoop in C Properties & Applications
Loop in C Properties & Applications
 
C language 2
C language 2C language 2
C language 2
 
Cpp loop types
Cpp loop typesCpp loop types
Cpp loop types
 
Loop
LoopLoop
Loop
 
Loops
LoopsLoops
Loops
 
C language (Part 2)
C language (Part 2)C language (Part 2)
C language (Part 2)
 
Loop structures
Loop structuresLoop structures
Loop structures
 
Chapter 9 - Loops in C++
Chapter 9 - Loops in C++Chapter 9 - Loops in C++
Chapter 9 - Loops in C++
 
Unit II chapter 4 Loops in C
Unit II chapter 4 Loops in CUnit II chapter 4 Loops in C
Unit II chapter 4 Loops in C
 
Igdpd c21 loops
Igdpd c21 loopsIgdpd c21 loops
Igdpd c21 loops
 
Computer programming 2 Lesson 8
Computer programming 2  Lesson 8Computer programming 2  Lesson 8
Computer programming 2 Lesson 8
 
Control structures repetition
Control structures   repetitionControl structures   repetition
Control structures repetition
 
Loops In C++
Loops In C++Loops In C++
Loops In C++
 
whileloop-161225171903.pdf
whileloop-161225171903.pdfwhileloop-161225171903.pdf
whileloop-161225171903.pdf
 
While loop
While loopWhile loop
While loop
 
C Programming - Decision making, Looping
C  Programming - Decision making, LoopingC  Programming - Decision making, Looping
C Programming - Decision making, Looping
 
Loops in c programming
Loops in c programmingLoops in c programming
Loops in c programming
 
Loops in c++
Loops in c++Loops in c++
Loops in c++
 
Loops
LoopsLoops
Loops
 

Recently uploaded

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 

Recently uploaded (20)

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 

Introduction to loops cpu

  • 1. PRESANTATION ON “Looping control structure” GUPTA HARSH 13ME030
  • 2. Introduction of loop • A loop is a programming structure that allows an action to repeat until the program meets a given condition. • After each iteration of a loop, the loop checks against a loop control expression to see if the program met a the given condition. If it did, the loop stops. If not, the loop moves on to the next iteration.
  • 3. CONTINUE… • Loop: a control structure that repeats a group of steps in a program • C loop control statements • Two types of control statement….. They are:- Exit control loop and Entry control loop
  • 4. Exit Control loop • In exit control loop, the body is executed first and then the condition is checked. • In exit control loop the body is executed at least once.
  • 5. Entry Control loop • In entry control loop, the condition is checked first and then body is executed. • In Entry control loop the body is not executed at all if the condition is false.
  • 6. Looping… • ‘C’ language provides following looping structures:- 1. WHILE 2. DO-WHILE 3. FOR
  • 7. WHILE LOOP – Of the three different loop structures offered in C, while- loops are conceptually the simplest. – Resembles if-statement, but does not have an else. – Conceptually, keep executing the loop body again and again till the condition is true. – Loop terminates when the loop condition becomes false. – Note that the truth of the loop condition is not checked constantly between every statement in the loop body, but only at the beginning of the loop, and then again between the repetitions of the loop body – Condition may be temporarily false during the loop, but become true again before it is checked
  • 8.
  • 9. DO-WHILE LOOP – The second type of loop offered in C is the do-while. – Clearly the least commonly used of the three: one famous study of real world programs revealed that out of all loops in them, only 1% are do-while. – Do-while behaves exactly the same way as the while-loop, but is guaranteed to execute its body at least once before it starts looking at the loop condition. – The possibility of executing the loop body zero times does not exist, even if the condition is initially false – do-while is most useful in situations where testing the condition simply does not make any sense until the loop body has been executed once
  • 10.
  • 11. FOR LOOP – The third type of loop structure in C is suitable for the common task of iterating through the values of a range of integers, one value at the time. – For example, go through the numbers from 1 to 100. – The for-loop header defines this range, and the loop body contains the statements you execute for each value. – To define an integer range, you need to define three things: where it begins (1), where it ends (100), and the step size between the consecutive values of the range (1)
  • 12. CONTINUE… – It is not a coincidence that the header of a for-loop consists of three parts, for the three things that define a range. – We can still use while like in countdown, but using a for-loop makes it clear that we are going through a range. – It is not a coincidence that the header of a for-loop consists of three parts, for the three things that define a range. – We can still use while like in countdown, but using a for-loop makes it clear that we are going through a range.
  • 13. Flowchart of FOR LOOP for( initializing list;condition; updation)
  • 14. BREAK STATEMENT • Remember the break keyword that we used to stop a switch statement from executing more than one statement? • break can also be used to exit an infinite loop • But it is almost always best to use a well- written while loop.
  • 15. CONTINUE STATEMENT – Continue is a statement similar to break, but instead of jumping out of the loop altogether, it jumps to the next round of the loop, skipping the rest of the body – Most commonly used to skip some of the values inside the range for which the loop doesn't need to do anything