Important MCQ

int a = 10; a += 5; now a is

Q.int a = 10; a += 5; now a is

A) 15
B) 10
C) 5
D) 105
Correct Answer:
Option A
Detailed Explanation:
A) 15 is correct. Arithmetic operators include +, -, *, /, %, ++ and --. Integer division produces an integer result; postfix uses the old value before updating, while prefix updates first.