- 5
If and else if statement
3 Answers
+ 3
If statement is used to check for a condition on a particular variable.
Else if is used to solve the problem of dangling else, where an else statement is executed if previously unmatched if condition evaluates to false.
+ 1
if (condition is true){print("somthing");}
else { if(conditions are false)print("somthing");}