Conditional statements let a program take different actions depending on the circumstances. These statements include several versions of If statements. Most languages also include a Case statement, which is a simpler way of writing a series of If statements.
The simple If statement executes a code block only if some condition is true. The following shows the If statement’s pseudocode:
<condition> is true, the program executes the code block. If
<condition> is false, the program skips the code block and executes the code that follows.
The If Else statement executes one of two code blocks depending on a condition’s value. The following shows the If Else statement’s pseudocode: