C程序按位取反练习
Admin | 2008-1-27 13:12:04 | 被阅次数 | 16790
本教程,学习C程序如何使用按位取反~
程序分析:~0=1; ~1=0;
程序源代码:
#include "stdio.h"
main()
{
int a,b;
a=234;
b=~a;
printf("\40: The a's 1 complement(decimal) is %d \n",b);
a=~a;
printf("\40: The a's 1 complement(hexidecimal) is %x \n",a);
}