学习使用^运算符

#include <stdio.h>
int main()
{   /*学习使用^运算符
        0^0=0 0^1=1 1^0=1 1^1=0*/
    int a, b;
    a=077;
    b=a^3;
    printf("\40:the a^b(decimal)is %d\n",b);
    b^=7;
    printf("\40:the a^b(decimal)is %d\n",b);
    getch();
    return 0;
}

posted @ 2013-03-03 19:23  王井玉  阅读(216)  评论(0)    收藏  举报