Sequencing & Selection (If & switch statements)

Fill in the blanks

When programming, there are different control structures that allow for the execution of specific code based on different s. Two common control structures are and .

Selection, on the other hand, allows the to be determined based on a condition. One way to achieve selection in programming is through the use of s. An if statement evaluates a condition and, if it is true, executes a specific block of code. If the condition is false, the block of code is skipped.

Another type of selection structure is the . A switch statement provides a convenient way to select one of many code blocks to be executed. It compares the condition with multiple cases and executes the block of code associated with the first true case. If none of the cases are true, a can be provided to execute code when none of the cases match.

Conditions are expressions that evaluate to a value, which is either true or false. A Boolean is a data type that can only have two values, representing true or false. Conditions are used within if statements, switch statements, and other control structures to determine which execution path to take based on their value.

In some cases, you may encounter s. These are if statements that are contained within another if statement's block of code. The inner if statement is only evaluated if the outer if statement's condition is true. This allows for more complex decision-making in programming.

Keywords

selection | default case | execution path | nested if statement | if statement | switch statement | boolean | condition | sequencing |