Example: if Condition
Use if conditional statement if you want to execute something based on some condition.
If 1 is greater than 0 then the condition is true and out will be True if the condition is false then the output will be false.
Declare two variables var mySal and var yoursal then display whose salary is greater.
Example: else Condition
Use the else statement when you want to execute the code every time the if condition evaluates to false.
Example: else-if condition
Use the “else if” condition when you want to apply the second level condition after the if statement.