1. IF condition
only if is true conditon is required.
if(condition)
{
//statements
}
2. IF-ELSE condition
1. to check whether the condition will be true or false.
syntax of if-else
2. only 1 condition
if(condition)
{
//statements
}
else
{
//statements
}
3. if - else if
we can add "else if" to execute multiple conditions
syntax
if(condition)
{
//statements
}
else if(condition)
{
//statements
}
else if(condition)
{
//statement
}
else
{
//statement
}
4. Nested if-else condition
if(condition)
{
//statements
if(condition)
{
//statement
}
else
{
//statement
}
//statement
}
else
{
//statements
if(condition)
{
// statement
}
else if(condition)
{
//statement
}
else
{
//statement
}
}