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

Introductiontoflowchart 110630082600-phpapp01
Introductiontoflowchart 110630082600-phpapp01Introductiontoflowchart 110630082600-phpapp01
Introductiontoflowchart 110630082600-phpapp01
VincentAcapen1
 
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
humphrieskalyn
 

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

All Types👩Of Sex Call Girls In Mohali 9053900678 Romance Service Mohali Call ...
All Types👩Of Sex Call Girls In Mohali 9053900678 Romance Service Mohali Call ...All Types👩Of Sex Call Girls In Mohali 9053900678 Romance Service Mohali Call ...
All Types👩Of Sex Call Girls In Mohali 9053900678 Romance Service Mohali Call ...
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 

Recently uploaded (20)

Top Rated Pune Call Girls Dehu road ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated  Pune Call Girls Dehu road ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...Top Rated  Pune Call Girls Dehu road ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Pune Call Girls Dehu road ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
 
Budhwar Peth { Russian Call Girls Pune (Adult Only) 8005736733 Escort Servic...
Budhwar Peth { Russian Call Girls Pune  (Adult Only) 8005736733 Escort Servic...Budhwar Peth { Russian Call Girls Pune  (Adult Only) 8005736733 Escort Servic...
Budhwar Peth { Russian Call Girls Pune (Adult Only) 8005736733 Escort Servic...
 
Call Girls Junnar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Junnar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Junnar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Junnar Call Me 7737669865 Budget Friendly No Advance Booking
 
All Types👩Of Sex Call Girls In Mohali 9053900678 Romance Service Mohali Call ...
All Types👩Of Sex Call Girls In Mohali 9053900678 Romance Service Mohali Call ...All Types👩Of Sex Call Girls In Mohali 9053900678 Romance Service Mohali Call ...
All Types👩Of Sex Call Girls In Mohali 9053900678 Romance Service Mohali Call ...
 
(ISHITA) Call Girls Service Malegaon Call Now 8250077686 Malegaon Escorts 24x7
(ISHITA) Call Girls Service Malegaon Call Now 8250077686 Malegaon Escorts 24x7(ISHITA) Call Girls Service Malegaon Call Now 8250077686 Malegaon Escorts 24x7
(ISHITA) Call Girls Service Malegaon Call Now 8250077686 Malegaon Escorts 24x7
 
best call girls in Pune | Whatsapp No 8005736733 VIP Escorts Service Availabl...
best call girls in Pune | Whatsapp No 8005736733 VIP Escorts Service Availabl...best call girls in Pune | Whatsapp No 8005736733 VIP Escorts Service Availabl...
best call girls in Pune | Whatsapp No 8005736733 VIP Escorts Service Availabl...
 
VVIP Pune Call Girls Sinhagad Road WhatSapp Number 8005736733 With Elite Staf...
VVIP Pune Call Girls Sinhagad Road WhatSapp Number 8005736733 With Elite Staf...VVIP Pune Call Girls Sinhagad Road WhatSapp Number 8005736733 With Elite Staf...
VVIP Pune Call Girls Sinhagad Road WhatSapp Number 8005736733 With Elite Staf...
 
VIP Model Call Girls Alandi ( Pune ) Call ON 8005736733 Starting From 5K to 2...
VIP Model Call Girls Alandi ( Pune ) Call ON 8005736733 Starting From 5K to 2...VIP Model Call Girls Alandi ( Pune ) Call ON 8005736733 Starting From 5K to 2...
VIP Model Call Girls Alandi ( Pune ) Call ON 8005736733 Starting From 5K to 2...
 
Get Premium Alandi Road Call Girls (8005736733) 24x7 Rate 15999 with A/c Room...
Get Premium Alandi Road Call Girls (8005736733) 24x7 Rate 15999 with A/c Room...Get Premium Alandi Road Call Girls (8005736733) 24x7 Rate 15999 with A/c Room...
Get Premium Alandi Road Call Girls (8005736733) 24x7 Rate 15999 with A/c Room...
 
Karve Nagar ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Karve Nagar ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Karve Nagar ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Karve Nagar ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Baner Pashan Link Road [ Escorts in Pune ₹7.5k Pick Up & Drop With Cash Payme...
Baner Pashan Link Road [ Escorts in Pune ₹7.5k Pick Up & Drop With Cash Payme...Baner Pashan Link Road [ Escorts in Pune ₹7.5k Pick Up & Drop With Cash Payme...
Baner Pashan Link Road [ Escorts in Pune ₹7.5k Pick Up & Drop With Cash Payme...
 
VVIP Pune Call Girls Narayangaon WhatSapp Number 8005736733 With Elite Staff ...
VVIP Pune Call Girls Narayangaon WhatSapp Number 8005736733 With Elite Staff ...VVIP Pune Call Girls Narayangaon WhatSapp Number 8005736733 With Elite Staff ...
VVIP Pune Call Girls Narayangaon WhatSapp Number 8005736733 With Elite Staff ...
 
VIP Model Call Girls Wakad ( Pune ) Call ON 8005736733 Starting From 5K to 25...
VIP Model Call Girls Wakad ( Pune ) Call ON 8005736733 Starting From 5K to 25...VIP Model Call Girls Wakad ( Pune ) Call ON 8005736733 Starting From 5K to 25...
VIP Model Call Girls Wakad ( Pune ) Call ON 8005736733 Starting From 5K to 25...
 
Booking open Available Pune Call Girls Sanaswadi 6297143586 Call Hot Indian ...
Booking open Available Pune Call Girls Sanaswadi  6297143586 Call Hot Indian ...Booking open Available Pune Call Girls Sanaswadi  6297143586 Call Hot Indian ...
Booking open Available Pune Call Girls Sanaswadi 6297143586 Call Hot Indian ...
 
Top Rated Pune Call Girls Baner ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Baner ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Baner ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Baner ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
 
Viman Nagar $ Call Girl in Pune | Starting ₹,5K To @25k with A/C 8005736733 E...
Viman Nagar $ Call Girl in Pune | Starting ₹,5K To @25k with A/C 8005736733 E...Viman Nagar $ Call Girl in Pune | Starting ₹,5K To @25k with A/C 8005736733 E...
Viman Nagar $ Call Girl in Pune | Starting ₹,5K To @25k with A/C 8005736733 E...
 
Hinjewadi ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready Fo...
Hinjewadi ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready Fo...Hinjewadi ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready Fo...
Hinjewadi ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready Fo...
 
(ISHITA) Call Girls Service Navi Mumbai Call Now 8250077686 Navi Mumbai Escor...
(ISHITA) Call Girls Service Navi Mumbai Call Now 8250077686 Navi Mumbai Escor...(ISHITA) Call Girls Service Navi Mumbai Call Now 8250077686 Navi Mumbai Escor...
(ISHITA) Call Girls Service Navi Mumbai Call Now 8250077686 Navi Mumbai Escor...
 
Kalyani Nagar & Escort Service in Pune Phone No 8005736733 Elite Escort Servi...
Kalyani Nagar & Escort Service in Pune Phone No 8005736733 Elite Escort Servi...Kalyani Nagar & Escort Service in Pune Phone No 8005736733 Elite Escort Servi...
Kalyani Nagar & Escort Service in Pune Phone No 8005736733 Elite Escort Servi...
 

etlplooping-170320213203.pptx