问几个C中赋值语句的问题
问题1:int n,n1,n2,n3,n4;
n1=n2=n3=n4=2;
n=n1+1,n2+2,n3+3,n4+4;
printf("n=%d\tn1=%d\tn2=%d\tn3=%d\tn4=%d\n",n,n1,n2,n3,n4);//输出为何是3 2 2 2 2?
n=(n1+1,n2+2,n3+3,n4+4);
printf("n=%d\tn1=%d\tn2=%d\tn3=%d\tn4=%d\n",n,n1,n2,n3,n4);//输出为何是6 2 2 2 2?
n=n1=n2=n3=2;
printf("n1=%d\tn2=%d\tn3=%d\n",n1=n+1,n2=n1+1,n3=n2+1);//输出为何是3 3 3?
n=n1=n2=n3=2;
printf("n3=%d\tn2=%d\tn1=%d\n",n3=n2+1,n2=n1+1,n1=n+1);//输出为何是5 4 3?
问题2:
int x;
int y=1;
int z=-1;
if(z<0)
if(z=y<0)-------------------if(z=y<0)这个语句什么意思?
x=3;
else if(y==0)
x=5;
else
x=7;
printf("x=%d\t",x);-----//为何输出7?
printf("z=%d\n",z);----//为何输出0?
if(x=z=y)
x=3;
printf("x=%d\t",x);----//为何输出3?
printf("z=%d\n",z);---//为何输出1?