I’m learning to code in C. I was going through the logical expressions but then this question came and I couldn’t understand ? Like are logical operators exceptional in case of precedence. Let’s take this one example:
i = 1; j = 1; k = 1;
printf("%d ", ++i || ++j && ++k);
printf("%d %d %d", i, j, k);
The compiler answer is 1 ,2,1,1 which means it short circuited. But i can’t understand that why didn’t the compiler follow the precedence (++ has higher precedence than ||) or is it just the way it’s designed in case of logical expressions? I just want to confirm. Thanks.it shows operator precedence