I am new to programming. Right now I am trying to learn precedence of operator in C. I try to analyse the code givenbelow.
#include<stdio.h>
int main()
{
int x, y, z;
x = y = z= -1;
z = ++x&&++y&&++z;
printf("x = %d y = %d z = %d", x, y ,z);
}
After learning precedence of operator, I understood unary operator has higher preference. So in the above code
z = ++0&&++0&&++0;
So value of x , y ,z is equal to zero, right? But after compiling I got answer as x = 0, y = -1 and z = 0.
Can any one help me to figure out this issue??