1(xii)
Assertion (A): The result of the Java expression 3 + 7/2 is 6.
Reason (R): According to the hierarchy of operators in Java, addition is done first followed by division.
- (a)(A) is true and (R) is false.
- (b)(A) is false and (R) is true.
- (c)Both (A) and (R) are true and (R) is a correct explanation of (A).
- (d)Both (A) and (R) are true and (R) is not a correct explanation of (A).
Show SolutionHide Solution↓
(A) is true and (R) is false.
Reason — In the expression 3 + 7/2, division has higher precedence than addition, so 7/2 is evaluated first using integer division, giving 3, and then added to 3 → 3 + 3 = 6, so Assertion (A) is true. However, the Reason (R) is incorrect because it wrongly states that addition is performed before division, which is not true in Java operator precedence.