The general structure of an if…else statement is as follows:
if (conditional_expression) {
body_of_task
} else {
body_of_task2
}
The general structure is clearly intuitive to understand. If the conditional expression produces a result that is TRUE, then it will execute the body_of_task section, and if the conditional expression is FALSE, then it will execute the body_of_task2 section. In this recipe, you will implement a small task to implement the if…else statement.