+ 3

JAVA

What is the output of the following code? int a = 11; int b = 12; int c = 40; if (a > 100 || b > 3) { System.out.println(a); } else { System.out.println(c); }

14th Feb 2018, 12:58 PM
Jinesh Chopra
Jinesh Chopra - avatar
4 Answers
+ 24
|| , OR returns true if any of the expressions evaluates to true a>100||b>3 is same as false||true true //hence print value of a
14th Feb 2018, 1:21 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 4
11 You can also write and save you code as below: https://code.sololearn.com/cK7GYX8el3hO/?ref=app
14th Feb 2018, 1:08 PM
📈SmileGoodHope📈
📈SmileGoodHope📈 - avatar
+ 3
11 i don't speak java
14th Feb 2018, 1:01 PM
Akib
Akib - avatar
0
11
15th Feb 2018, 11:53 AM
Intizar Malik
Intizar Malik - avatar