Ternary Operator's in c#
Let's understand the concept -->
-
- In C#, the ternary operator is a shorthand way of writing an if-else statement in a single line.
- C# includes a special type of of decision making operator ? : called the ternary operator.
- Boolean expression ? First Statement : Second Statement
Explanation-->
-
- Here, condition is a Boolean expression that is evaluated to either true or false. If the condition is true, the value_if_true expression is returned, otherwise, the value_if_false expression is returned.
0 Comments