What one can learn from ternary operator? Because in1>n2 and n1<n2 are giving different output. An example program is given. Problem is highlighted.
using System;
class Program
{
static void Main(string[] args)
{
int n1, n2;
n1 = 10;
n2 = 20;
int max = (n1 > n2) ? n1 : n2;
Console.WriteLine(max);//20
int min = (n1 < n2) ? n1 : n2;
Console.WriteLine(min);//10
Console.ReadKey();
}
}