Which of the following statements about the if-else control structure is true? 

  • It can only test for numeric conditions. 
  • It executes the else block if the if condition is true. 
  • It allows for multiple conditions to be checked in sequence. 
  • It requires both if and else parts.
The if-else control structure in C++ provides a way to perform decision-making operations. If the condition inside the 'if' block evaluates to true, the 'if' block of code is executed; otherwise, the 'else' block is executed, if present. It can be used to check multiple conditions in sequence by nesting or using "else if".
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *