An if-else statement is a programming construct that allows the program to make decisions based on a condition. It consists of an if block and an else block, where the code inside the if block is executed when the condition evaluates to true, and the code inside the else block is executed when the condition evaluates to false.
Related terms
if statement: A programming construct that allows for conditional execution of code based on a Boolean expression.
Boolean expression: An expression or statement that returns either true or false.
conditionals: Statements that perform different actions based on whether a certain condition is true or false.