有以下稗宇: #include main() { int a=1,b=2,c=3,x; x=(a^b.&c: printf(“%d\n”,x); } 程序的运行结果是( )。

admin2020-05-19  14

问题 有以下稗宇:
    #include
    main()
    {    int a=1,b=2,c=3,x;
    x=(a^b.&c:
    printf(“%d\n”,x);
    }
程序的运行结果是(    )。

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

答案A

解析 本题考查位运算符以及相关运算。^为按位或,&为按位与,那么a^b为3,再与c按位与仍然为3,所以答案为A选项。
转载请注明原文地址:https://kaotiyun.com/show/9cCp777K
0

相关试题推荐
最新回复(0)