Your Ad Here

Saturday, May 24, 2008

Grestest Of Three Numbers

// Greater Of Three Numbers

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

namespace Step2
{
class Program
{
static void Main(string[] args)
{
long a, b,c;
start:
try
{

Console.WriteLine("Enter Three Nos");
a = Convert.ToInt64(Console.ReadLine());
b = Convert.ToInt64(Console.ReadLine());
c = Convert.ToInt64(Console.ReadLine());

if (a > b && a > c)
Console.WriteLine("{0} is greater ", a);
else if (b > c && b > a)
Console.WriteLine("{0} is greater", b);
else
Console.WriteLine("{0} is Greater", c);
}

catch (Exception e)
{
Console.WriteLine(e.Message);
goto start;
}
}
}
}

1 comment:

Anonymous said...

Keep up the good work.