if(110&101)是真是假;if(110&110) 是真是假

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/28 13:00:03
if(110&101)是真是假;if(110&110) 是真是假

if(110&101)是真是假;if(110&110) 是真是假
if(110&101)是真是假;if(110&110) 是真是假

if(110&101)是真是假;if(110&110) 是真是假
& 是 二进制 按位 “与”(按位乘)运算.
1&0=0,1&1=1,0&0=0.
“与”完看是不是全是0,不是全0则为真,否则为假.
用c程序算一下也知真假:
#include
#include
main ()
{
if (110 & 101) {
printf("110 & 101 is true\n");
} else {printf("110 & 101 is false\n");}
if(110 & 110) {
printf("110 & 110 is true\n");
} else {printf("110 & 110 is false\n");}
exit(0);
}
-------------------
结果:
110 & 101 is true
110 & 110 is true