using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace whichOneIsGreatest
{
class Program
{
static void Main(string[] args)
{
int Num1, Num2, Num3;
Console.WriteLine("Enter the Number");
Console.Write("Num1:");
Num1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the Number");
Console.Write("Num2:");
Num2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the Number");
Console.Write("Num3:");
Num3 = Convert.ToInt32(Console.ReadLine());
if (Num1 > Num2 && Num1 > Num3)
{
Console.WriteLine("The Greatest Number is:" + Num1);
}
else if (Num2 > Num1 && Num2 > Num3)
{
Console.WriteLine("The Greatest Number is:" + Num2);
}
else if (Num3 > Num1 && Num3 > Num2)
{
Console.WriteLine("The Greatest Number is:" + Num3);
}
else if (Num1 == Num2 && Num1 == Num3)
{
Console.WriteLine("All number are same");
Console.ReadLine();
}
}
}
}
No comments:
Post a Comment