Wednesday 27 July 2016

C Sharp Nested If Else Tutorial

class Program
    {
        static void Main(string[] args)
        {
            int a, b, c;
            Console.Write("Enter Three numbers>>");
            a = int.Parse(Console.ReadLine());
            b = int.Parse(Console.ReadLine());
            c = int.Parse(Console.ReadLine());

            if (a > b)

            {
                if (a > c)
                    Console.Write("A");
                else
                    Console.Write("C");
            }
            else
            {
                if (b > c)
                    Console.Write("B");
                else
                    Console.Write("C");
            }
        }
    }

No comments:

Post a Comment