Discussion in 'C' started by IndiraP, Nov 17, 2012.
Code: main() { int a=10,b=20,c; c = a+++b; printf("%d",c); } output is 30.. how does this work???
main() { int a=10,b=20,c; c = a+++b; printf("%d",c); }
++ increments a and next + is an addition
yes sir...forgot dat was a post increment.. so a+b n then a is incremented.. thank u sir..
Just to add... Maximum munch rule is follwed here. ie: It uses (a++ ) + b instead of a + (++b)
thank u for the info..
Separate names with a comma.