Csharp Decision
# C# Decision Making
Decision structures require the programmer to specify one or more conditions to be evaluated or tested, along with the statements to be executed if the condition is true (required) and the statements to be executed if the condition is false (optional).
Here is the general form of a typical decision-making structure found in most programming languages:

## Decision Statements
C# provides the following types of decision-making statements. Click on the links to see the details of each statement.
| Statement | Description |
| --- | --- |
| (#) | An **if statement** consists of a boolean expression followed by one or more statements. |
| [if...else statement](#) | An **if statement** can be followed by an optional **else statement**, which executes when the boolean expression is false. |
| (#) | You can use one **if** or **else if** statement inside another **if** or **else if** statement. |
| (#) | A **switch** statement allows testing a variable for equality against a list of values. |
| (#) | You can use one **switch** statement inside another **switch** statement. |
| [C# Null Conditional Operator](#) | C# 6.0 introduced the null conditional operator ?. to safely access properties or methods without writing a bunch of if checks. |
## ? : Operator
We have already discussed the **conditional operator ? :** in the previous chapter, which can be used to replace **if...else** statements. Its general form is:
Exp1 ? Exp2 : Exp3;
Here, Exp1, Exp2, and Exp3 are expressions. Please note the usage and placement of the colon.
The value of the ? expression is determined by Exp1. If Exp1 is true, then Exp2 is evaluated, and the result becomes the value of the entire ? expression. If Exp1 is false, then Exp3 is evaluated, and the result becomes the value of the entire ? expression.
YouTip