阅读下面语句,则程序的执行结果是【 】。 #include "stdio.h" main() { int a=-1,b=1,k; if((++a

admin2010-12-10  29

问题 阅读下面语句,则程序的执行结果是【  】。
#include "stdio.h"
main()
{    int a=-1,b=1,k;
if((++a<0)&&!(b--<=0))
    printf("%d,%d\",a,b);
else printf("%d,%d\n",b,a);}

选项

答案1,0

解析 与运算两边的语句必须同时为真时,结果才为真。当执行完if((++a<0)&&!(b--<=0))时,a,b的值已经发生了变化。
转载请注明原文地址:https://kaotiyun.com/show/hTPp777K
0

最新回复(0)