204k views
2 votes
Your help is much appreciated, thank you so much.

Which of the following statements is true about selection structures? An else statement must be provided after the if statement. The if statement can have no else statement corresponding A break state

1 Answer

5 votes

Final answer:

The correct statement about selection structures is that an else statement must be provided after the if statement.

Step-by-step explanation:

The correct statement about selection structures is that an else statement must be provided after the if statement.

Selection structures, also known as conditional statements, are used in programming to control the flow of execution based on certain conditions. They can be implemented using if statements and their corresponding else statements. An else statement is optional, but it should be provided when there is a need for an alternative action to be taken if the condition in the if statement is not met.

For example:

if (x > 5) {
// do something
} else {
// do something else
}

User Gabe Sumner
by
7.9k points