The nested if statement executes an If block inside another If block. First, it checks the outer If condition; if it is true, it runs the inner If block.
Syntax
if(condition) // Outer if
{
//code
if(condition) // inner if
{
//code
}
}