Hello,
Syntax 1 :
if (condition1)
{
// Code block executed if condition1 is true
}
else if (condition2)
{
// Code block executed if condition2 is true
}
else
{
// Code block executed if none of the conditions are true
}
Syntax 2 :
if (condition1)
{
// Code block executed if condition1 is true
}
else
{
if (condition2)
{
// Code block executed if condition2 is true
}
}
else
{
// Code block executed if none of the conditions are true
}