+ 3
Why the output is 4 in both b and b++? I am not able to understand this. Kindly help.
2 Answers
+ 12
because it prints b first, then adds 1 to it. Try ++b.
+ 9
++b is pre-incrementing (add first, do stuff later)
b++ is post-incrementing (do stuff first, add later)