The conditional statement IF ELSE , is use for examining the conditions that we provided, and making decision based on that contition. The conditional statement examining the data using comparison operators as well as logical operators.
If --your condition here--
Your code here
Else
Your code Here
End If
If the contition is TRUE then the control goes to between IF and Else block , that is the program will execute the code between IF and ELSE statements.
If the contition is FLASE then the control goes to between ELSE and END IF block , that is the program will execute the code between ELSE and END IF statements.
If you want o check more than one condition at the same time , you can use ElseIf .
If --your condition here--
Your code here
ElseIf --your condition here--
Your code here
ElseIf --your condition here--
Your code here
Else
Your code Here
End If
Just take a real-time example - When we want to analyze a mark lists we have to apply some conditions for grading students depends on the marks.