SlideShare a Scribd company logo
1 of 19
Prepared By
Mahantesh S. Devoor
Content
 Objective
 Introduction
Types of looping
while
do-while
for
 Assessment metric
Conclusion
References
Course Objective
 Understand the basic terminology used in computer
programming
 It stresses the strengths of C, which provide students with
the means of writing efficient, maintainable, and portable
code.
 write, compile and debug programs in C language.
 Increase the ability to learn new programming languages
OBJECTIVES
Topic Objective
 Understand the basics of looping.
 To use the while, do-while and for repetition statement to
execute statements in a program repeatedly.
INTRODUCTION
Statements in a program are executed one after the other
ex: statement 1;
statement 2;
:
statement n;
Sometimes, the user want to execute a set of statements
repeatedly.
Loop statements are used to repeat the execution of
statement or blocks.
Iteration of a loop: the number of times the body of loop is
executed.
 Two types of loop structure are:
Pretest : Entry - controlled loop
Posttest : Exit – controlled loop
Pretest Vs. Posttest
Pretest : Condition is tested before each iteration to check
if loops should occur.
Posttest : Condition is tested after each iteration to check
if loop should continue (at least a single iteration occurs).
Conditio
n
Evaluate
d
Statements
false
true Conditio
n
Evaluate
d
Statements
true
false
TYPES OF LOOP
 while loop
 do-while loop
 for loop
while Loop
It has a loop condition only that is tested before each
iteration to decide whether to continue or terminate the
loop.
The body of a while loop will execute zero or more
times
Syntax:
while (<condition>){
<statement/block>;
}
Example :
int i=0;
while(i<3){
printf(“Hellon”);
i++;
}
Output:
Hello
Hello
Hello
Conditio
n
Evaluate
d
Statements
true
false
Flow diagram
do…while Loop
Do while has a loop condition only that is tested after
each iteration to decide whether to continue with next
iteration or terminate the loop.
Syntax:
do{
<statement/block>;
}while(condition);
Example:
int i=0;
do{
Printf (“Hellon”);
i++;
} while (i<3);
Output:
Hello
Hello
Hello
Conditio
n
Evaluate
d
Statements
true
false
Flow diagram
for Loop
for loop has three parts:
 Initializer is executed at start of loop.
 Loop condition is tested before iteration to decide
whether to continue or terminate the loop.
 Increment is executed at the end of each loop iteration.
Syntax:
for( [initialize]; [condition]; [incrementor] )
{
<statement/block>;
}
Flow diagram
Conditio
n
Evaluate
d
initialization
Statements
increament
true false
Example:
for(i=0; i<3; i++)
{
printf(“Hellon”);
}
Output:
Hello
Hello
Hello
ASSESSMENT METRIC
 What is looping? List the types of looping.
 Explain the while loop with an example.
 Give the difference between while and do-while loops
 Explain the syntax of for loop with an example
 List out the difference between while and for loop. And also
explain the do-while loop.
CONCLUSION
Importance of loops in any programming language is
immense, they allow us to reduce the number of lines in a
code, making our code more readable and efficient.
REFERENCES
[1]. E. Balaguruswamy, “Programming in ANSI C”, Third
edition, Tata McGraw Hill Publications, 2002.
[2]. P. B. Kotur, “Computer
programming”, Kindle Edition,
Bangalore, 2009.
Concepts
Sapna Book
and C
House,
etlplooping-170320213203.pptx

More Related Content

Similar to etlplooping-170320213203.pptx

Similar to etlplooping-170320213203.pptx (20)

Loops c++
Loops c++Loops c++
Loops c++
 
loops and iteration.docx
loops and iteration.docxloops and iteration.docx
loops and iteration.docx
 
Control Statement IN C.pptx
Control Statement IN C.pptxControl Statement IN C.pptx
Control Statement IN C.pptx
 
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
 
Cpp loop types
Cpp loop typesCpp loop types
Cpp loop types
 
dizital pods session 5-loops.pptx
dizital pods session 5-loops.pptxdizital pods session 5-loops.pptx
dizital pods session 5-loops.pptx
 
Loops in c
Loops in cLoops in c
Loops in c
 
Loops
LoopsLoops
Loops
 
PPT_203105211_3.pptx
PPT_203105211_3.pptxPPT_203105211_3.pptx
PPT_203105211_3.pptx
 
Loop-1.pptx
Loop-1.pptxLoop-1.pptx
Loop-1.pptx
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
 
C language 2
C language 2C language 2
C language 2
 
Visula C# Programming Lecture 4
Visula C# Programming Lecture 4Visula C# Programming Lecture 4
Visula C# Programming Lecture 4
 
Introductiontoflowchart 110630082600-phpapp01
Introductiontoflowchart 110630082600-phpapp01Introductiontoflowchart 110630082600-phpapp01
Introductiontoflowchart 110630082600-phpapp01
 
Ch05
Ch05Ch05
Ch05
 
M C6java6
M C6java6M C6java6
M C6java6
 
NRG 106_Session 4_CLanguage.pptx
NRG 106_Session 4_CLanguage.pptxNRG 106_Session 4_CLanguage.pptx
NRG 106_Session 4_CLanguage.pptx
 
C++ Loops General Discussion of Loops A loop is a.docx
C++ Loops  General Discussion of Loops A loop is a.docxC++ Loops  General Discussion of Loops A loop is a.docx
C++ Loops General Discussion of Loops A loop is a.docx
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 

Recently uploaded

Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...
Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...
Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...kumargunjan9515
 
Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...
Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...
Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...HyderabadDolls
 
Call Girls Surat ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Surat ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Surat ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Surat ( 8250092165 ) Cheap rates call girls | Get low budgetSareena Khatun
 
Erotic Vijayawada Call Girls Service 👉 6378878445 👉 Just📲 Call Ruhi Call Gir...
Erotic  Vijayawada Call Girls Service 👉 6378878445 👉 Just📲 Call Ruhi Call Gir...Erotic  Vijayawada Call Girls Service 👉 6378878445 👉 Just📲 Call Ruhi Call Gir...
Erotic Vijayawada Call Girls Service 👉 6378878445 👉 Just📲 Call Ruhi Call Gir...vershagrag
 
Unlimited Short Call Girls in Jamnagar { 9332606886 } VVIP NISHA Call Girls N...
Unlimited Short Call Girls in Jamnagar { 9332606886 } VVIP NISHA Call Girls N...Unlimited Short Call Girls in Jamnagar { 9332606886 } VVIP NISHA Call Girls N...
Unlimited Short Call Girls in Jamnagar { 9332606886 } VVIP NISHA Call Girls N...kumargunjan9515
 
HiFi Call Girl Service Hyderabad | Whatsapp No 📞 9352988975 📞 VIP Escorts Ser...
HiFi Call Girl Service Hyderabad | Whatsapp No 📞 9352988975 📞 VIP Escorts Ser...HiFi Call Girl Service Hyderabad | Whatsapp No 📞 9352988975 📞 VIP Escorts Ser...
HiFi Call Girl Service Hyderabad | Whatsapp No 📞 9352988975 📞 VIP Escorts Ser...kajalverma014
 
Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...
Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...
Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...Sareena Khatun
 
The most insightful Call Girls Danapur 9332606886 HOT & SEXY Models beautifu...
The most insightful Call Girls Danapur  9332606886 HOT & SEXY Models beautifu...The most insightful Call Girls Danapur  9332606886 HOT & SEXY Models beautifu...
The most insightful Call Girls Danapur 9332606886 HOT & SEXY Models beautifu...Sareena Khatun
 
Call Girls in Sihor - 8250092165 Our call girls are sure to provide you with ...
Call Girls in Sihor - 8250092165 Our call girls are sure to provide you with ...Call Girls in Sihor - 8250092165 Our call girls are sure to provide you with ...
Call Girls in Sihor - 8250092165 Our call girls are sure to provide you with ...Sareena Khatun
 
Call Girls Kothrud / 8250092165 Genuine Call girls with real Photos and Number
Call Girls Kothrud / 8250092165 Genuine Call girls with real Photos and NumberCall Girls Kothrud / 8250092165 Genuine Call girls with real Photos and Number
Call Girls Kothrud / 8250092165 Genuine Call girls with real Photos and NumberSareena Khatun
 
Foreigner Call Girls in junagadh 8250092165 Call Girls Advance Cash On Deliv...
Foreigner Call Girls in junagadh  8250092165 Call Girls Advance Cash On Deliv...Foreigner Call Girls in junagadh  8250092165 Call Girls Advance Cash On Deliv...
Foreigner Call Girls in junagadh 8250092165 Call Girls Advance Cash On Deliv...Sareena Khatun
 
High Profile Call Girls Service in Sangli 9332606886 HOT & SEXY Models beaut...
High Profile Call Girls Service in Sangli  9332606886 HOT & SEXY Models beaut...High Profile Call Girls Service in Sangli  9332606886 HOT & SEXY Models beaut...
High Profile Call Girls Service in Sangli 9332606886 HOT & SEXY Models beaut...Sareena Khatun
 
Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...
Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...
Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...gragfaguni
 
Call Girls Chakan ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Chakan ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Chakan ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Chakan ( 8250092165 ) Cheap rates call girls | Get low budgetSareena Khatun
 
fostac ppt_food safety and training certificate
fostac ppt_food safety and training certificatefostac ppt_food safety and training certificate
fostac ppt_food safety and training certificateadityjobymathew1
 
Top profile Call Girls In Deoghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Deoghar [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In Deoghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Deoghar [ 7014168258 ] Call Me For Genuine Models W...gajnagarg
 
Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...
Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...
Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...Sareena Khatun
 
Call Girls in Bhuj / 8250092165 Genuine Call girls with real Photos and Number
Call Girls in Bhuj / 8250092165 Genuine Call girls with real Photos and NumberCall Girls in Bhuj / 8250092165 Genuine Call girls with real Photos and Number
Call Girls in Bhuj / 8250092165 Genuine Call girls with real Photos and NumberSareena Khatun
 
Call Girls Nagpur / 8250092165 Genuine Call girls with real Photos and Number
Call Girls Nagpur / 8250092165 Genuine Call girls with real Photos and NumberCall Girls Nagpur / 8250092165 Genuine Call girls with real Photos and Number
Call Girls Nagpur / 8250092165 Genuine Call girls with real Photos and NumberSareena Khatun
 
PRESTAIR MANUFACTURER OF DISPLAY COUNTER
PRESTAIR MANUFACTURER OF DISPLAY COUNTERPRESTAIR MANUFACTURER OF DISPLAY COUNTER
PRESTAIR MANUFACTURER OF DISPLAY COUNTERPRESTAIR SYSTEMS LLP
 

Recently uploaded (20)

Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...
Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...
Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...
 
Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...
Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...
Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...
 
Call Girls Surat ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Surat ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Surat ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Surat ( 8250092165 ) Cheap rates call girls | Get low budget
 
Erotic Vijayawada Call Girls Service 👉 6378878445 👉 Just📲 Call Ruhi Call Gir...
Erotic  Vijayawada Call Girls Service 👉 6378878445 👉 Just📲 Call Ruhi Call Gir...Erotic  Vijayawada Call Girls Service 👉 6378878445 👉 Just📲 Call Ruhi Call Gir...
Erotic Vijayawada Call Girls Service 👉 6378878445 👉 Just📲 Call Ruhi Call Gir...
 
Unlimited Short Call Girls in Jamnagar { 9332606886 } VVIP NISHA Call Girls N...
Unlimited Short Call Girls in Jamnagar { 9332606886 } VVIP NISHA Call Girls N...Unlimited Short Call Girls in Jamnagar { 9332606886 } VVIP NISHA Call Girls N...
Unlimited Short Call Girls in Jamnagar { 9332606886 } VVIP NISHA Call Girls N...
 
HiFi Call Girl Service Hyderabad | Whatsapp No 📞 9352988975 📞 VIP Escorts Ser...
HiFi Call Girl Service Hyderabad | Whatsapp No 📞 9352988975 📞 VIP Escorts Ser...HiFi Call Girl Service Hyderabad | Whatsapp No 📞 9352988975 📞 VIP Escorts Ser...
HiFi Call Girl Service Hyderabad | Whatsapp No 📞 9352988975 📞 VIP Escorts Ser...
 
Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...
Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...
Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...
 
The most insightful Call Girls Danapur 9332606886 HOT & SEXY Models beautifu...
The most insightful Call Girls Danapur  9332606886 HOT & SEXY Models beautifu...The most insightful Call Girls Danapur  9332606886 HOT & SEXY Models beautifu...
The most insightful Call Girls Danapur 9332606886 HOT & SEXY Models beautifu...
 
Call Girls in Sihor - 8250092165 Our call girls are sure to provide you with ...
Call Girls in Sihor - 8250092165 Our call girls are sure to provide you with ...Call Girls in Sihor - 8250092165 Our call girls are sure to provide you with ...
Call Girls in Sihor - 8250092165 Our call girls are sure to provide you with ...
 
Call Girls Kothrud / 8250092165 Genuine Call girls with real Photos and Number
Call Girls Kothrud / 8250092165 Genuine Call girls with real Photos and NumberCall Girls Kothrud / 8250092165 Genuine Call girls with real Photos and Number
Call Girls Kothrud / 8250092165 Genuine Call girls with real Photos and Number
 
Foreigner Call Girls in junagadh 8250092165 Call Girls Advance Cash On Deliv...
Foreigner Call Girls in junagadh  8250092165 Call Girls Advance Cash On Deliv...Foreigner Call Girls in junagadh  8250092165 Call Girls Advance Cash On Deliv...
Foreigner Call Girls in junagadh 8250092165 Call Girls Advance Cash On Deliv...
 
High Profile Call Girls Service in Sangli 9332606886 HOT & SEXY Models beaut...
High Profile Call Girls Service in Sangli  9332606886 HOT & SEXY Models beaut...High Profile Call Girls Service in Sangli  9332606886 HOT & SEXY Models beaut...
High Profile Call Girls Service in Sangli 9332606886 HOT & SEXY Models beaut...
 
Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...
Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...
Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...
 
Call Girls Chakan ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Chakan ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Chakan ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Chakan ( 8250092165 ) Cheap rates call girls | Get low budget
 
fostac ppt_food safety and training certificate
fostac ppt_food safety and training certificatefostac ppt_food safety and training certificate
fostac ppt_food safety and training certificate
 
Top profile Call Girls In Deoghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Deoghar [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In Deoghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Deoghar [ 7014168258 ] Call Me For Genuine Models W...
 
Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...
Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...
Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...
 
Call Girls in Bhuj / 8250092165 Genuine Call girls with real Photos and Number
Call Girls in Bhuj / 8250092165 Genuine Call girls with real Photos and NumberCall Girls in Bhuj / 8250092165 Genuine Call girls with real Photos and Number
Call Girls in Bhuj / 8250092165 Genuine Call girls with real Photos and Number
 
Call Girls Nagpur / 8250092165 Genuine Call girls with real Photos and Number
Call Girls Nagpur / 8250092165 Genuine Call girls with real Photos and NumberCall Girls Nagpur / 8250092165 Genuine Call girls with real Photos and Number
Call Girls Nagpur / 8250092165 Genuine Call girls with real Photos and Number
 
PRESTAIR MANUFACTURER OF DISPLAY COUNTER
PRESTAIR MANUFACTURER OF DISPLAY COUNTERPRESTAIR MANUFACTURER OF DISPLAY COUNTER
PRESTAIR MANUFACTURER OF DISPLAY COUNTER
 

etlplooping-170320213203.pptx