int a=3;
int ans=a+a++;
output: 7
-------------------------------------
int a=3;
int ans=a+a+a++;
output: 9
-------------------------------------
int a=4
int ans=a+a+a+a++;
output: 12
Basically, you're writing code for which there is no defined behaviour. Don't do that. Don't mix increments and decrements of a variable with other uses of that same variable.