#include<stdio.h>voidmain(){intp,a=5;if(p=a!=0)printf("%d\n",p);elseprintf("%d\n",p+2);}程序运行后的输出结果是
if(p=a!=0),先判断a!=0,由于a=5,因此表达式成立,所以p值为1,if条件成立,因此执行printf("%d\n",p);最终输出为1这个题的考察点就是判断=操作符和!=操作符哪个优先级更高。