I believe that you have already received your answer, but just to reflect a little, let me add one more clarification. First, to quote the properties of the && and || , from C11 , chapters Β§6.5.13 and Β§6.5.13 respectively,
(I)
The && operator must give 1 if both its operands are compared not equal to 0; otherwise, it gives 0. [...] If the first operand compares equal to 0 , the second operand is not evaluated.
and
(Ii)
Operator || must give 1 if one of its operands is compared not equal to 0; otherwise it gives 0. [...]. If the first operand compares unevenly with 0 , the second operand is not evaluated.
and both guarantee a score from left to right. So, comparing your code,
d = ++a && ++b || ++c;
it happens like
d = ((++a && ++b) || ++c );
which is rated as
d = (( 6 && ++b ) || ++c);
and then
d = ( ( 6 && (-6) ) || ++c);
Now in the previous step (I) is performed, and it reduces to
d = ( 1 || ++c);
Now, after an accent that already matches (II), therefore, no further evaluation of the operand RHS || (i.e. ++c not evaluated) and it looks like d = 1 and the final result 1 is stored in d .
That, a == 6 , b == -6 , c == 0 and d ==1 .
Having said that void main() should be changed to int main(void) , at least to conform to the standard.