- C# Program

Turnary Operator

using System;
namespace TurnaryOperatorApp
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = 10, b = 22, max;
            max = a > b ? a : b;
            Console.WriteLine("Max is :" + max);
            
            //nested turnary operator
            int c = 56;
            max = a > b ?( a > c ? a : c) : (b > c ? b : c);
            Console.WriteLine("Max is :" + max);
        }
    }
}