please give the output of this code
int x = 5;
if (x > 1 && r < 10)
++X;
else
X--
System.out.println (x);
Answers
Answered by
0
Answer:
you will get the output as 6 because, both the condition in if statement are satisfied by x so it will go inside if condition and it will increase x value by 1
but make sure that as java is case sensitive language you use the case of variables correctly
Explanation:
let me know if you want to know more on this or any other topics of java
Similar questions