Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Find the greatest number between the three number. (http://www.go4expert.com/forums/find-the-greatest-number-between-the-t25860/)

Patel 22May2011 10:16

Find the greatest number between the three number.
 
Code:

using System;
using System.Collections.Generic;
using System.Text;

namespace greatestno
{
    class Program
    {
       
        static void Main(string[] args)
        {
        int num1, num2, num3;
        Console.WriteLine("Enter the num1");
        num1=Int32.Parse(Console.ReadLine());
        Console.WriteLine("Enter the num2");
        num2 = Int32.Parse(Console.ReadLine());
        Console.WriteLine("Enter the num1");
        num3 = Int32.Parse(Console.ReadLine());
        if (num1 >num2)
            if (num1 > num3)
                Console.WriteLine("Num1 is the greatest no. :");
            else
                Console.WriteLine("Num3 is the greatest no. :");
        else
            if (num2 > num3)
                Console.WriteLine("Num2 is the greatest no. :");
            else
                Console.WriteLine("Num3 is the greatest no. :");
        Console.ReadLine();
        }
    }
}



All times are GMT +5.5. The time now is 00:10.