+ 1

Help

Help me to figure out. why output is '2'? https://code.sololearn.com/W4yk6YYo270G/?ref=app

17th Jan 2019, 11:58 PM
k😎d
k😎d - avatar
2 Answers
+ 5
it evaluate from left so first is c>b what gives 1 (true).Next 1is less than a so false.
18th Jan 2019, 12:16 AM
Hubert Dudek
Hubert Dudek - avatar
+ 3
You could fix that using if(c > b && b > a){}
18th Jan 2019, 12:54 AM
Roel
Roel - avatar