Important MCQ

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

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

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