Answer: else is a selection statement used with
if statement to execute the alternate conditions of
if statement.
Example,
int x = 10, y = 5;
if (x == y)
{
Console.WriteLine("Both x and y are equal....");
}
else
{
Console.WriteLine("Both x and y are not equal....");
}
Asked In: Spotted While Learning |
Alert Moderator