1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Find the greatest number between the three number.

Discussion in 'C#' started by Patel, May 22, 2011.

  1. Patel

    Patel New Member

    Joined:
    Dec 5, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Lucknow
    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();
            }
        }
    }
     
    Last edited by a moderator: May 22, 2011

Share This Page