Important MCQ

int x = 5; int y = ++x; y is

Q.int x = 5; int y = ++x; y is

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