8.int a=7,;int b=8;printf(”%d“,a&b);
7:0.....0 0......0 0.......0 00000111
8:0......0 0......0 0.......0 00001000
都为1时为1,其他为0;所以输出值为:0
9.int a=7;int b=8;printf(”%d“,a^b)
7:0......0 0......0 0......0 00000111
8:0......0 0.......0 0......0 00001000
a^b时不同为1,相同为0.所以输出值为15.
时间: 2024-10-09 23:37:18