Advertisement
Advertisement
//C# else if statement example
using System;
class ElseIfEx
{
public static void Main()
{
int a = 99, b = 100, c = 90;
if(a>b)
Console.WriteLine("{0} is greater than {1}", a, b);
else if(a<c)
Console.WriteLine("{0} is less than {1}", a, c);
else
Console.WriteLine("{0} is greater than {1} and less than {2}", a, c, b);
}
}
99 is greater than 90 and less than 100
Advertisement
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement