Chapter 3. Expressions and Control Structures

IN BRIEF

In this chapter, we will explore the basic control structures provided by C#. Each of these constructs will be explored and discussed in terms of syntax and proper usage.

WHAT YOU NEED

RECOMMENDED SOFTWARE.NET Framework Visual Studio .NET
RECOMMENDED HARDWARE.NET-enabled desktop client
SKILLS REQUIREDC# coding

EXPRESSIONS AND CONTROL STRUCTURES AT A GLANCE

Expressions and Control Structures53  
Basic Expressions53  
Legal Variable Names53  
Using C# Operators54  
Pre/Post Operators60  
Program Flow Control: Control Structures60  
 The Program Execution Path60Short Circuit Evaluation62
 Conditional Statements60Using the Ternary Operator64
 The if Control Structure61The switch Statement65
 The if/else Control Structure Combination61  
Looping68  
 The for Loop68The while Loop70
 Using the for Statement68The do..while Loop72
 The foreach Statement69  

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.3.72