+ 2

can someone define me the sequence of if else??

3rd Dec 2020, 4:59 AM
Joyce
Joyce - avatar
8 Respuestas
+ 12
Yea sure Joyce Now see that if statement can be followed by an optional else statement, that executes when the boolean expression is false not true... Here's the syntax - if(boolean_expression) { /* statement(s) will execute if the boolean expression is true */ } else { /* statement(s) will execute if the } If the boolean expression evaluates to true, then the if block of code is executed, otherwise else block will be excuted.. I hope I have cleared this👍
3rd Dec 2020, 5:05 AM
Piyush
Piyush - avatar
+ 8
See this thread if u still didnt understand: https://www.sololearn.com/Discuss/1729260/?ref=app
3rd Dec 2020, 5:07 AM
Alphin K Sajan
Alphin K Sajan - avatar
3rd Dec 2020, 5:00 AM
Alphin K Sajan
Alphin K Sajan - avatar
+ 5
if (condition1) { // executes if condition1 is true } else { // if condition1 is false then , the stmts inside else gets executed... }
3rd Dec 2020, 5:03 AM
Alphin K Sajan
Alphin K Sajan - avatar
+ 5
Thankyouuuu so much!!❤ Alphin K Sajan Piyush[21 Dec❤️]
3rd Dec 2020, 10:38 AM
Joyce
Joyce - avatar
+ 4
If is done first. Then the else ifs in order and finally else.
4th Dec 2020, 8:27 AM
Sonic
Sonic - avatar
+ 3
Joyce Wlcm :)
3rd Dec 2020, 11:53 AM
Alphin K Sajan
Alphin K Sajan - avatar
+ 2
I mean in a clear explanation huhu I didn't understand
3rd Dec 2020, 5:01 AM
Joyce
Joyce - avatar