if-else Statement
if-else Statement
An if……else statement works on the following principle,
- execute the block of code inside if statement if the expression evaluates True. After execution return to the code out of the if……else block.
- execute the block of code inside else statement if the expression evaluates False. After execution return to the code out of the if……else block.
Example:
Output: