以下程序的运行结果是( )。 #include<stdio.h> main() {int a=3,b=4,C=8,d=4,m=1,n=3; printf("%d\n",(m=a>b)&&(n=c>d));}

admin2021-04-28  13

问题 以下程序的运行结果是(    )。
#include<stdio.h>
main()
{int a=3,b=4,C=8,d=4,m=1,n=3;
printf("%d\n",(m=a>b)&&(n=c>d));}

选项 A、0
B、1
C、2
D、3

答案A

解析 逻辑与(&&)运算符的功能是:当“&&”运算符两边的运算对象均为1时,整个表达式的值为1,否则为0。因为a=3<b=4,即m=0,所以整个表达式的值为0。
转载请注明原文地址:https://kaotiyun.com/show/4Ptp777K
0

最新回复(0)