单选题 C语言
题号 #2268689

有以下程序:
#include<stdiO.h>
main(  )
{int a=1,b=0;
printf("%d,",b=a+b);
printf("%d\n",a=2+b);    ‘’
}
程序运行后的输出结果是(  )。

进入在线模考

参考答案

D

答案解析

a=1,b=0,那么b=a+b=1+0=1,此时b已经等于1,所以a=2+b=3,正解应为1,3  (本解析由233网校学员提供)

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考