0
else if and if else
what is the difference between else if and if else?
2 Antworten
+ 4
If, else and else if help to construct 'branch' code. Basically, you employ them whenever you want to make a decision.
The 'IF' portion is the only block that is absolutely mandatory. Where 'ELSE' allows you to execute something when 'IF' block is not true. So, only one out of them will be executed for the particular condition.
So, basically, ELSE is a part of 'IF' construct and 'ELSE IF' is a combination of two IFs, where other-thing is an IF itself.
0
Thank you so much..