Consider the following Program:-
#include <stdio.h>
int main()
{
short a = 1, b = 1, c = 1, d;
d = ((a++ || b++ && c++) || 1);
printf("a= %d, b = %d, c= %d, d= %d", a,b,c,d);
return 0;
}
Output:-
a = 2, b = 1, c = 1, d = 1;
Even though the precedence of AND is greater than that of OR, which means && should be executed before ||, but it is not happening. Why??