If Else Ladder
using System;
class If_else_ladder_Demo
{
static void Main(string[] args)
{
int a = 3;
if (a == 1)
{
Console.WriteLine("Value of a is 1");
}
else if (a == 2)
{
Console.WriteLine("Value of a is 2");
}
else if (a == 3)
{
Console.WriteLine("Value of a is 3");
}
Console.ReadLine();
}
}
Output:
Value of a is 3