i = 4;
ans = ++i + ++i ;
answer would have been 12 .
as , first i is incremented to 5 , but we don’t print it yet … then it is incremented to 6 .
and now we use the current value of i in hand , thus 6+6=12
now when we have
int i = 4, ans;
ans = ++i + ++i + ++i;
Now + is a binary operator which is left to right associative ;
in addition to the 12 that we got above i will be again incremented to 7 and the value of i is written , thus 12+7=19.
Having said that , it is an undefined behavior of C , and we cannot guarantee a particular output.