Computer Science, asked by shreyaberry920, 8 months ago

26. Determine the output of the following program.
public class PredictOutput3
{
public static void main(String args[])
int a = 2, b = 2, c = 2;
System.out.println("Output 1:" + (a + 2 < b + c));
System.out.println("Output 2: " + (a + 2 < (b + c)));
}
}
Guys plz help me ❤​

Answers

Answered by prashantrohilla32
5

Answer:  false in both case

Explanation:

because a=2, b=2,c=2

case 1:    a+2<b+c    = 2+2<2+2 =    4<4       =false

case 2:  a+2<(b+c)    = 2+2<(2+2) =  4<(4)    =false

left hand side and right hand side are equal in both cases.

Attachments:
Similar questions