CONDITIONAL STATEMENT

1.if statement

if (condition) {

    // code to be executed if the condition is true

}

2.if – else statement

if (condition) {

    // code to be executed if the condition is true

} else {

    // code to be executed if the condition is false

}

3.else-if statement

if (condition1) {

    // code to be executed if condition1 is true

} else if (condition2) {

    // code to be executed if condition2 is true

} else {

    // code to be executed if all conditions are false

}

switch case statement

Used when there are multiple cases and you want to perform different actions based on the value of an expression.

switch (expression) {

    case value1:

        // code to be executed if expression equals value1

        break;

    case value2:

        // code to be executed if expression equals value2

        break;

    // ... additional cases

    default:

        // code to be executed if expression doesn't match any case

}