• Have Any Question?
  • contact@eitworld.com

csharp.net decision making





  • A selection statement is a control statement that allows for choosing between two or more execution paths in a program on the basis of some condition.
  • C#.Net includes one-way, two-way and n-way (multiple) selectors.
    • An if statement with no else is a one way selector.
    • An if..else statement is a two way selector.
    • if..elseif..else, nested if and switch statements are n-way selectors.
  • C#.Net includes the following selection statements:
Statement Description
if statement An if statement consists of a boolean expression followed by one or more statements.
If..Then..Else statement An if statement can be followed by an optional else statement, which executes when the boolean expression is false.
If..Then..Else if..Else statement An if statement can be followed by an optional else statement, which executes when the boolean expression is false.
Nested If statement You can use one if or else if statement inside another if or else if statement(s).
Select….Case statement A switch statement allows a variable to be tested for equality against a list of values.


Real Time Web Analytics