C# program to find whether a number is greater or small.
using System; using System.Collections.Generic; using System.Text; namespace greater { class Program { static void Main(string[] args) { int a, b, c; //Greater Number ---- Comparing with three values Console.WriteLine("ENTER THE VALUE OF A :- "); a = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("ENTER THE VALUE OF B :- "); b = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("ENTER THE VALUE OF C :- "); c = Convert.ToInt32(Console.ReadLine()); if (a > b && a > c) { Console.WriteLine("A IS GREATER FROM ALL NUMBERS."); } else if (b > a && b > c) { Console.WriteLine("B IS GREATER FROM ALL NUMBERS."); } else if (c > a && c > b) { Console.WriteLine("C IS GREATER FROM ALL NUMBERS."); } else { Console.WriteLine("ALL NUMBER ARE EQUAL."); } Console.ReadLine(); } } }
ENTER THE VALUE OF A :- 5 ENTER THE VALUE OF B :- 6 ENTER THE VALUE OF C :- 2 B IS GREATER FROM ALL NUMBERS.