Step 1: Evaluate the expression \(3 + 7/2\) using Java rules.
In Java, when both operands of division are integers, integer division is performed. This means the decimal part is discarded.
So,
\[
7/2 = 3
\]
Now substitute this value into the expression:
\[
3 + 7/2 = 3 + 3 = 6
\]
Hence, the
Assertion (A) is true.
Step 2: Check the operator precedence in Java.
According to the operator precedence rules in Java,
division is performed before addition, not the other way round.
So in the expression
\[
3 + 7/2
\]
first \(7/2\) is evaluated, and after that \(3\) is added.
Therefore, the statement given in the Reason that
addition is done first followed by division is incorrect.
Step 3: Analyze Assertion and Reason together.
Let us compare both statements carefully:
- Assertion (A): True, because \(7/2 = 3\) in integer division, and \(3 + 3 = 6\).
- Reason (R): False, because Java follows precedence where division is done before addition.
So, the Assertion is correct, but the Reason is wrong.
Step 4: Choose the correct option.
The option that correctly matches this situation is:
\[
\text{(A) (A) is true and (R) is false.}
\]
Final Answer:(A) Assertion is true and Reason is false.