Skip to main content

An if-else statement is a programming conditional statement that runs a different set of statements depending on whether an expression is true or false.

For a general example of an if-else statement, not specific to any particular programming language, see "What is an if else".