C Sharp program to find largest of given 3 numbers


using System;

namespace largetOfThreeNums
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, c, big;
            Console.Write("Enter First value: ");
            a = int.Parse(Console.ReadLine());
            Console.Write("Enter Second value: ");
            b = int.Parse(Console.ReadLine());
            Console.Write("Enter Third value: ");
            c = int.Parse(Console.ReadLine());
            big = a;
            if (b > big)
                big = b;
            if (c > big)
                big = c;
            Console.WriteLine("Biggest of given 3 numbers = " + big);
            Console.ReadLine();
        }
    }
}

1 comments :

Related Posts with Thumbnails
 

Copyright © 2012. GS dot net - All Rights Reserved - Design by BTDesigner - Proudly powered by Blogger