To check which number is greater than 3 digit number in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace value
{
class Program
{
static void Main(string[] args)
{
int f;
int s;
int t;
Console.WriteLine("enter the first number");
f =int.Parse( Console.ReadLine());
Console.WriteLine("enter the second number");
s = int.Parse(Console.ReadLine());
Console.WriteLine("enter the third number");
t = int.Parse(Console.ReadLine());
if (f > s && f>t)
{
Console.WriteLine("first number is greater :-{0}",f);
}
else if (s > t && s>f )
{
Console.WriteLine("second number is greater :-{0}",s);
}
else if (t > f && t> s)
{
Console.WriteLine("third number is greater :-{0}",t);
}
else
{
Console.WriteLine("equal");
}
Console.ReadLine();
}
}
}
output:-
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace value
{
class Program
{
static void Main(string[] args)
{
int f;
int s;
int t;
Console.WriteLine("enter the first number");
f =int.Parse( Console.ReadLine());
Console.WriteLine("enter the second number");
s = int.Parse(Console.ReadLine());
Console.WriteLine("enter the third number");
t = int.Parse(Console.ReadLine());
if (f > s && f>t)
{
Console.WriteLine("first number is greater :-{0}",f);
}
else if (s > t && s>f )
{
Console.WriteLine("second number is greater :-{0}",s);
}
else if (t > f && t> s)
{
Console.WriteLine("third number is greater :-{0}",t);
}
else
{
Console.WriteLine("equal");
}
Console.ReadLine();
}
}
}
output:-