Hi C programmers, i got stuck at this piece of code and concept of precedence, associativity and order of evaluation within printf() in C.Most of you are adept C programmers.So please, you gotta help me out in explaining the output of this code.This post may clarify some of your queries as well as unary operators are very important.
#include <stdio.h>
void main()
{
int j = 1;
printf("%d%d%d%d" ,++j,j++,j,--j);
}
Output is 2022
but as my friends and I thought, it should be 2020 if we consider the order of evaluation to be R to L.
Please reply to this post if you find a possible explanation to it.