If...else statement

If...else statement is used when you want do some operations only if some condition is true or false.
For example, if you want to display whether number is odd or even. You would use if...else statement.

Syntax of if...else statement:

if(condition) {
    // statement(s) to perform operations when condition is true
} else {
    // statement(s) to perform operations when condition is false
}

Example using if...else statement. In this example, We display whether number is even or odd.