Answers for "example of ternary operator in C# / Ternary Operator ? / Question mark"

C#
0

example of ternary operator in C# / Ternary Operator ? / Question mark

condition ? statement 1 : statement 2
Posted by: Guest on September-17-2021
0

example of ternary operator in C# / Ternary Operator ? / Question mark

int x = 20, y = 10;

var result = x > y ? "x is greater than y" : "x is less than y";

Console.WriteLine(result);
Posted by: Guest on September-17-2021

C# Answers by Framework

Browse Popular Code Answers by Language