Ternary Operator
The ternary operator condition ? true_value : false_value returns one of two values.
int age = 20;string status = age >= 18 ? "Adult" : "Minor";Console.WriteLine(status);Run the Application
Section titled “Run the Application”dotnet runResult
Section titled “Result”Adult