C#
Program Flow ControlC# - Program Flow Control
Selection Statements
The if Statement
Multiple else Clauses
How C# Enforces if Rules
The switch Statement
Combining Case Labels
No Fall-Through in switch Statements
Iteration Statements
The while Statement
The do/while Statement
The for Statement
Nested Loops
Using the Comma Operator
The foreach Statement
Branching with Jump Statements
The break Statement
Breaking Out of Infinite Loops
The continue Statement
The Infamous goto Statement
The goto Statement: A (Very) Brief History
Using the goto Statement
The return Statement
Summary
The statements that enable you to control program flow in a C# application fall into three main categories: selection statements, iteration statements, and jump statements. In each of these cases, a test resulting in a Boolean value is performed and the Boolean result is used to control the application's flow of execution. In this tutorial, you'll learn how to use each of these statement types to control structure flow.