C program
int i=1; printf("%d %d %d",++i, i++, ++i);
I am completely surprised about the output.
The Output of the above program:-
4 2 4
I know they saved values in the stack and then print the values on the console(i.e right to left execution)
If I follow right to left execution, it must print the following output
4 2 2
- C++ program
Same happened with "C++";
int i=1;
cout<<++i<<i++<++i;
It also produces the same O/p as in the "C" program
4 2 4
Will anyone know by which logic the values are printing in the console ?