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

5th Oct 2016, 8:32 PM
Khloud Mohamed
Khloud Mohamed - avatar
2 Answers
+ 1
It prints the value of a since the condition is true. '||' is the OR operator, meaning only one of the conditions needs to be true (which 'b>3' is) for the statement to be executed.
6th Oct 2016, 2:53 AM
Liam
Liam - avatar
0
11
5th Oct 2016, 9:06 PM
Ashraf Ali Mohammed Naji Sinan
Ashraf Ali Mohammed Naji Sinan - avatar