13. if else if else
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ifelseifexample
{
class Program
{
static void Main(string[] args)
{
int a, b,c;
Console.Write("Enter Value of A:");
a = Convert.ToInt16(Console.ReadLine());
Console.Write("Enter Value of B:");
b = Convert.ToInt16(Console.ReadLine());
Console.Write("Enter Value of C:");
c = Convert.ToInt16(Console.ReadLine());
if (a > b && a>c)
{
Console.WriteLine("A is Max");
}
else if (b > a && b>c)
{
Console.WriteLine("B is Max");
}
else if (c > a && c > b)
{
Console.WriteLine("C is Max");
}
else
{
Console.WriteLine("Either of Two Value is Same");
}
Console.Read();
}
}
Comments
Post a Comment