ICSE Class 10 Computer Applications
Question 2 of 30
Solved 2024 Question Paper ICSE Class 10 Computer Applications — Question 7
Back to all questionsa
Reason — The && (Logical AND) operator in Java is used to combine two boolean expressions. It returns true only if both expressions are true. If either of the expressions is false, the entire condition becomes false.
The condition if (a > b && b > c) checks two expressions:
a > b– Checks ifais greater thanb.b > c– Checks ifbis greater thanc.
Since both conditions must be true (due to the && operator), the logical sequence becomes:
a > b > c
In this sequence:a is the largest number because it is greater than both b and c.