- Back to Home »
- C#.NET »
- C#.NET Conditional Statements
Posted by :
Sudhir Chekuri
Thursday, 31 December 2015
A block of code that executes basing upon a condition is Conditional Statement . Conditional statements are used to execute a block of code only when the condition is satisfied.
Conditional statements are classified into two types.
1) Conditional Branching – If and Switch
2) Conditional Looping – For, for each, while and do while
C# has two constructs for branching code.
1) If Statement
2) Switch Statement
Those are as follows
1) for loop
2) while loop
3) dowhile loop
4) foreach loop
Conditional statements are classified into two types.
1) Conditional Branching – If and Switch
2) Conditional Looping – For, for each, while and do while
C#.NET Conditional Branching
These statements allow you to branch code depending on whether the certain conditions met or not.C# has two constructs for branching code.
1) If Statement
2) Switch Statement
C#.NET Conditional Looping
C# provides four different loops that allows you to execute a block of code repeatedly until a certain condition is met.Those are as follows
1) for loop
2) while loop
3) dowhile loop
4) foreach loop