C位运算符的使用

#include <stdio.h>

int main(void)
{
	//位运算符 & | ^ ~

	printf("8|2=%d
",8|2);// 10
	printf("12&6=%d
",12&6);//4
	printf("12^6=%d
",12^6);//4
	printf("~8=%d
",~227);//-228
	
	printf("12&&2=%d
",12&&6);//1
	
	printf("12||2=%d
",12||6);//1
	return 0;
}

  

原文地址:https://www.cnblogs.com/wanglijun/p/8470869.html