0
Doubt clear me
int a=5; a=a++ + a++; printf("%d",a); ans is 11 but ++a + a++ is 13 how explain me by step
3 Answers
0
6+7=13
++a + a++ is also 13 how
- 1
1) depends on compiler..
2) the compiler you are using doing like this...
first a++=5(post increment)...
now for the second its already 6 now...
so 5+6=11
3) some compilers do like...
2 a++>> a=6>>12...
4) do this...a= ++a + ++a...;
5) tell me what you got.
- 1
means
first...++a...(pre incr)
6
then ++a...(pre incr aain)
7...and add...13
sm compiler do...7+7=14