c语言中的按位与和按位或


#include "stdafx.h"

int main(int argc, char* argv[])
{
    
    
	int a=9,b=5,c,d;
	c=a|b;
	d=a&b;
	printf("a=%d,b=%d,c=%d,d=%d\n",a,b,c,d);
	return 0;
}

输出:

a=9,b=5,c=13,d=1

猜你喜欢

转载自blog.csdn.net/chendongpu/article/details/121283922
今日推荐