In the following piece of C code, I would expect the printed output to be 5794. But when I compile it with GCC (7.5.0) the output is 5693. Why?
int main()
{
int x=20,y=35;
x=y++ + x++;
y= ++y + ++x;
printf("%d%d",x,y);
}
this program has undefined behavior.which means you can't predict what will happen.
look for more information here Sequence_point