Answer:
The answer to this question can be given as:
// code to if-else ladder statement can be given as:
if(isBalloon==true && isRed!=true) //if block
{
cout<<"Balloon"; //message
}
else if ((isBalloon && isRed)==true) //else if block
{
cout<<"Red balloon"; //message
}
else //else block
{
cout<<"Not a balloon"; //message
}
Explanation:
In the above code, we use the if-else ladder statement. In this statement, we use two variables and AND logical operator. AND operator executes when both condition is true. The following if-else ladder statement can be described as: