SlideShare a Scribd company logo
1 of 18
Statement-Level
Control Structures
1
Controlling Program Flows
• Computations in imperative-language
programs
– Evaluating expressions – reading variables,
executing operations
– Assigning resulting values to variables
– Selecting among alternative control flow paths
– Causing repeated execution
• A control structure is a control statement and
the statements whose execution it controls
• Most programming languages follow a single
thread of control (or scheduling)
2
Selection Statements
• A selection statement chooses between two or
more paths of execution
• Two general categories:
– Two-way selectors
– Multiple-way selectors
3
Two-Way Selection Statements
• General form:
if control_expression
then clause
else clause
• Control expression:
– In C, Python, and C++, the control expression can
be arithmetic
– In languages such as Ada, Java, Ruby, and C#, the
control expression must be Boolean
4
Nesting Selectors
• Consider the following Java code:
if (sum == 0)
if (count == 0)
result = 0;
else result = 1;
• Which if gets the else? (dangling else)
• Java's static semantics rule: else matches with
the nearest if
5
Nesting Selectors (cont.)
• To force an alternative semantics, compound
statements may be used:
if (sum == 0) {
if (count == 0)
result = 0;
}
else result = 1;
• The above solution is used in C, C++, and C#
• Perl requires that all then and else clauses to
be compound and avoid the above problem
6
Nesting Selectors (cont.)
7
Multiple-Way Selection Statements
• Allow the selection of one of any number of
statements or statement groups
• Switch in C, C++, Java:
switch (expression) {
case const_expr_1: stmt_1;
…
case const_expr_n: stmt_n;
[default: stmt_n+1]
}
8
Switch in C, C++, Jave
• Design choices for C’s switch statement
– Control expression can be only an integer type
– Selectable segments can be statement sequences,
blocks, or compound statements
– Any number of segments can be executed in one
execution of the construct (there is no implicit
branch at the end of selectable segments); break is
used for exiting switch  reliability of missing
break
– default clause is for unrepresented values (if there
is no default, the whole statement does nothing)
9
Multiple-Way Selection Using if
• Multiple selectors can appear as direct
extensions to two-way selectors, using else-if
clauses, for example in Python:
if count < 10 :
bag1 = True
elseif count < 100 :
bag2 = True
elseif count < 1000 :
bag3 = True
10
Iterative Statements
• The repeated execution of a statement or
compound statement is accomplished either by
iteration or recursion
• Counter-controlled loops:
– A counting iterative statement has a loop variable,
and a means of specifying the loop parameters:
initial, terminal, stepsize values
– Design Issues:
• What are the type and scope of the loop variable?
• Should it be legal for the loop variable or loop
parameters to be changed in the loop body?
11
Iterative Statements: C-based
for ([expr_1] ; [expr_2] ; [expr_3]) statement
• The expressions can be whole statements or
statement sequences, separated by commas
– The value of a multiple-statement expression is the
value of the last statement in the expression
– If second expression is absent, it is an infinite loop
• Design choices:
– No explicit loop variable  the loop needs not
count
– Everything can be changed in the loop
– 1st expr evaluated once, others with each iteration
12
Logically-Controlled Loops
• Repetition control based on Boolean
expression
• C and C++ have both pretest and posttest
forms, and control expression can be
arithmetic:
while (ctrl_expr) do
loop body loop body
while (ctrl_expr)
• Java is like C, except control expression must
be Boolean (and the body can only be entered
at the beginning -- Java has no goto)
13
User-Located Loop Control
• Programmers decide a location for loop
control (other than top or bottom of the loop)
• Simple design for single loops (e.g., break)
• C , C++, Python, Ruby, C# have unconditional
unlabeled exits (break), and an unlabeled
control statement, continue, that skips the
remainder of current iteration, but not the loop
• Java and Perl have unconditional labeled exits
(break in Java, last in Perl) and labeled
versions of continue
14
User-Located Loop Control (cont’d)
int a = 10;
while( a < 17 )
{
if( a == 15) {
/* skip the iteration */
a = a + 1;
continue;
}
printf(“ %d ,", a);
a++;
The result is 10,11,12,13,14,16,17,
Change continue by break the result is 10,11,12,13,14,
15
User-Located Loop Control
• In Java:
outerLoop:
for (row = 0; row < numRows; row++)
for (col = 0; col < numCols; col++)
{ sum += mat[row][col];
if (sum > 1000.0)
break outerLoop;
}
16
Unconditional Branching
• Transfers execution control to a specified
place in the program, e.g., goto
• Major concern: readability
– Some languages do not support goto statement
(e.g., Java)
– C# offers goto statement (can be used in switch
statements)
• Loop exit statements are restricted and
somewhat hide away goto’s
17
Thank you
18

More Related Content

Similar to chapter 6.pptx

Operators loops conditional and statements
Operators loops conditional and statementsOperators loops conditional and statements
Operators loops conditional and statementsVladislav Hadzhiyski
 
Control structures repetition
Control structures   repetitionControl structures   repetition
Control structures repetitionOnline
 
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...FabMinds
 
03 conditions loops
03   conditions loops03   conditions loops
03 conditions loopsManzoor ALam
 
C-Programming Control statements.pptx
C-Programming Control statements.pptxC-Programming Control statements.pptx
C-Programming Control statements.pptxSKUP1
 
C-Programming Control statements.pptx
C-Programming Control statements.pptxC-Programming Control statements.pptx
C-Programming Control statements.pptxLECO9
 
Repetition, Basic loop structures, Loop programming techniques
Repetition, Basic loop structures, Loop programming techniquesRepetition, Basic loop structures, Loop programming techniques
Repetition, Basic loop structures, Loop programming techniquesJason J Pulikkottil
 
Control Structures.pptx
Control Structures.pptxControl Structures.pptx
Control Structures.pptxssuserfb3c3e
 
System verilog control flow
System verilog control flowSystem verilog control flow
System verilog control flowPushpa Yakkala
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Rasan Samarasinghe
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming languageVasavi College of Engg
 

Similar to chapter 6.pptx (20)

Operators loops conditional and statements
Operators loops conditional and statementsOperators loops conditional and statements
Operators loops conditional and statements
 
ch8.ppt
ch8.pptch8.ppt
ch8.ppt
 
Control structures repetition
Control structures   repetitionControl structures   repetition
Control structures repetition
 
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
 
03 conditions loops
03   conditions loops03   conditions loops
03 conditions loops
 
ch5.ppt
ch5.pptch5.ppt
ch5.ppt
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 
C-Programming Control statements.pptx
C-Programming Control statements.pptxC-Programming Control statements.pptx
C-Programming Control statements.pptx
 
C-Programming Control statements.pptx
C-Programming Control statements.pptxC-Programming Control statements.pptx
C-Programming Control statements.pptx
 
Plc part 3
Plc  part 3Plc  part 3
Plc part 3
 
Repetition, Basic loop structures, Loop programming techniques
Repetition, Basic loop structures, Loop programming techniquesRepetition, Basic loop structures, Loop programming techniques
Repetition, Basic loop structures, Loop programming techniques
 
Control Structures.pptx
Control Structures.pptxControl Structures.pptx
Control Structures.pptx
 
Control structure
Control structureControl structure
Control structure
 
Java 2.pptx
Java 2.pptxJava 2.pptx
Java 2.pptx
 
System verilog control flow
System verilog control flowSystem verilog control flow
System verilog control flow
 
PM1
PM1PM1
PM1
 
Slide 6_Control Structures.pdf
Slide 6_Control Structures.pdfSlide 6_Control Structures.pdf
Slide 6_Control Structures.pdf
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming language
 
C++ chapter 4
C++ chapter 4C++ chapter 4
C++ chapter 4
 

Recently uploaded

VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort servicejennyeacort
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Data Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxData Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxFurkanTasci3
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...ThinkInnovation
 
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一fhwihughh
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...Florian Roscheck
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
Data Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxData Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptx
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
 
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 

chapter 6.pptx

  • 2. Controlling Program Flows • Computations in imperative-language programs – Evaluating expressions – reading variables, executing operations – Assigning resulting values to variables – Selecting among alternative control flow paths – Causing repeated execution • A control structure is a control statement and the statements whose execution it controls • Most programming languages follow a single thread of control (or scheduling) 2
  • 3. Selection Statements • A selection statement chooses between two or more paths of execution • Two general categories: – Two-way selectors – Multiple-way selectors 3
  • 4. Two-Way Selection Statements • General form: if control_expression then clause else clause • Control expression: – In C, Python, and C++, the control expression can be arithmetic – In languages such as Ada, Java, Ruby, and C#, the control expression must be Boolean 4
  • 5. Nesting Selectors • Consider the following Java code: if (sum == 0) if (count == 0) result = 0; else result = 1; • Which if gets the else? (dangling else) • Java's static semantics rule: else matches with the nearest if 5
  • 6. Nesting Selectors (cont.) • To force an alternative semantics, compound statements may be used: if (sum == 0) { if (count == 0) result = 0; } else result = 1; • The above solution is used in C, C++, and C# • Perl requires that all then and else clauses to be compound and avoid the above problem 6
  • 8. Multiple-Way Selection Statements • Allow the selection of one of any number of statements or statement groups • Switch in C, C++, Java: switch (expression) { case const_expr_1: stmt_1; … case const_expr_n: stmt_n; [default: stmt_n+1] } 8
  • 9. Switch in C, C++, Jave • Design choices for C’s switch statement – Control expression can be only an integer type – Selectable segments can be statement sequences, blocks, or compound statements – Any number of segments can be executed in one execution of the construct (there is no implicit branch at the end of selectable segments); break is used for exiting switch  reliability of missing break – default clause is for unrepresented values (if there is no default, the whole statement does nothing) 9
  • 10. Multiple-Way Selection Using if • Multiple selectors can appear as direct extensions to two-way selectors, using else-if clauses, for example in Python: if count < 10 : bag1 = True elseif count < 100 : bag2 = True elseif count < 1000 : bag3 = True 10
  • 11. Iterative Statements • The repeated execution of a statement or compound statement is accomplished either by iteration or recursion • Counter-controlled loops: – A counting iterative statement has a loop variable, and a means of specifying the loop parameters: initial, terminal, stepsize values – Design Issues: • What are the type and scope of the loop variable? • Should it be legal for the loop variable or loop parameters to be changed in the loop body? 11
  • 12. Iterative Statements: C-based for ([expr_1] ; [expr_2] ; [expr_3]) statement • The expressions can be whole statements or statement sequences, separated by commas – The value of a multiple-statement expression is the value of the last statement in the expression – If second expression is absent, it is an infinite loop • Design choices: – No explicit loop variable  the loop needs not count – Everything can be changed in the loop – 1st expr evaluated once, others with each iteration 12
  • 13. Logically-Controlled Loops • Repetition control based on Boolean expression • C and C++ have both pretest and posttest forms, and control expression can be arithmetic: while (ctrl_expr) do loop body loop body while (ctrl_expr) • Java is like C, except control expression must be Boolean (and the body can only be entered at the beginning -- Java has no goto) 13
  • 14. User-Located Loop Control • Programmers decide a location for loop control (other than top or bottom of the loop) • Simple design for single loops (e.g., break) • C , C++, Python, Ruby, C# have unconditional unlabeled exits (break), and an unlabeled control statement, continue, that skips the remainder of current iteration, but not the loop • Java and Perl have unconditional labeled exits (break in Java, last in Perl) and labeled versions of continue 14
  • 15. User-Located Loop Control (cont’d) int a = 10; while( a < 17 ) { if( a == 15) { /* skip the iteration */ a = a + 1; continue; } printf(“ %d ,", a); a++; The result is 10,11,12,13,14,16,17, Change continue by break the result is 10,11,12,13,14, 15
  • 16. User-Located Loop Control • In Java: outerLoop: for (row = 0; row < numRows; row++) for (col = 0; col < numCols; col++) { sum += mat[row][col]; if (sum > 1000.0) break outerLoop; } 16
  • 17. Unconditional Branching • Transfers execution control to a specified place in the program, e.g., goto • Major concern: readability – Some languages do not support goto statement (e.g., Java) – C# offers goto statement (can be used in switch statements) • Loop exit statements are restricted and somewhat hide away goto’s 17