Ternary Operator Code Snippet in C#

Below is a sample source code demonstrating the ternary operator in c#

using System;

namespace AbundantCode

{

internal class Program

{

// Ternary Operator Code Snippet in C#

private static void Main(string[] args)

{

int Input1 = 18, Input2 = 15;

bool Output;

Output = (Input1 > Input2 ? true : false);

System.Console.WriteLine("Result of Ternary Operator = " + Output);

}

}

}
%d