[Solved] Result should be 11 after incrementing, it is 12, why? [closed]


*p1 refers to the value pointed by the pointer p1. (*p1)++ will increment the value of n by 1 and (*p2)++ will again do the increment on n, since it is pointing to the same location of p1. So the n will be incremented to 12. *p1,*p2 and n will thus have 12. So it prints 12.

0

solved Result should be 11 after incrementing, it is 12, why? [closed]