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); | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

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);

I know the answer is '11' but how? Why 'b' is not the answer?

30th Sep 2017, 6:20 PM
Vaibhavy Darshan
Vaibhavy Darshan - avatar
3 Answers
+ 16
if (11 > 100 || 12 > 3) if (false || true) if (true) System.out.println(a); // 11
30th Sep 2017, 6:36 PM
Babak
Babak - avatar
0
I didn't see how to print c
7th Jan 2020, 6:57 AM
Rabi'u Abba
0
11
30th Nov 2021, 6:30 AM
Prince Jaime