若有以下程序 #include<stdio.h> main(){int a=-11,b=10; a/=b/=-4: printf("%d%d\n",a,b);} 则程序的输出结果是

admin2019-08-10  29

问题 若有以下程序
#include<stdio.h>
main(){int a=-11,b=10;
        a/=b/=-4:
        printf("%d%d\n",a,b);}
则程序的输出结果是

选项 A、-1-2
B、5-2
C、4-3
D、5-3

答案B

解析 对于语句“a/=b,=-4;”相当于“a=a/(b=b/-4);”a初值为-11,b的初值为10,则运算以后10/-4值为-2,-11/-2值为5。
转载请注明原文地址:https://kaotiyun.com/show/RMRp777K
0

随机试题
最新回复(0)