若有以下程序 #include <stdio.h> main() { int c; c= 10^5; printf("%d\n", c); } 则程序的输出结果是

admin2020-07-28  23

问题 若有以下程序
     #include <stdio.h>
     main()
     {  int  c;
        c= 10^5;
        printf("%d\n", c);
     }
则程序的输出结果是

选项 A、5
B、15
C、10000
D、105

答案B

解析 本题考查位运算中按位异或运算符,异或运算只有在两个比较的位不同时其结果是1,否则结果为0,10用二进制表示为00001010,5用二进制表示为00000101,异或后00001111,即15,选项B正确。
转载请注明原文地址:https://kaotiyun.com/show/wF3p777K
0

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