0

else if and if else

what is the difference between else if and if else?

4th Jan 2019, 3:43 AM
Manoj Neupane
Manoj Neupane - avatar
2 Answers
+ 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.
4th Jan 2019, 4:21 AM
Dr. BHAVESH K LUKKA
0
Thank you so much..
4th Jan 2019, 4:25 AM
Manoj Neupane
Manoj Neupane - avatar