April 2010
Intermediate to advanced
976 pages
23h 2m
English
This chapter discusses C#’s program control statements. There are three categories of program control statements: selection statements, which are the if and the switch; iteration statements, which consist of the for, while, do-while, and foreach loops; and jump statements, which include break, continue, goto, return, and throw. Except for throw, which is part of C#’s exception-handling mechanism and is discussed in Chapter 13, the others are examined here.
Chapter 2 introduced the if statement. It is examined in detail here. The complete form of the if statement is
if(condition) statement;
else statement;
where the targets of the if and else are single statements. The else clause is optional. ...
Read now
Unlock full access