学习使用按位取反.

#include <stdio.h>
int main()
{        /*学习使用按位取反
            程序分析:0~=1 1~=0*/
    unsigned int a, b;
    a=3;
    b=~a;
    printf("\40:the a's 1 complement(decimal)is %d\n",b);
    a=~b;
    printf("\40:the a's 1 complement(hexidecimal)is %d\n",a);
    getch();
    return 0;
}

原文地址:https://www.cnblogs.com/wangjingyuwhy/p/2941847.html