#include "stdio.h" main() { int a,b; a=077; b=a&3; b&=7; printf("/40: The a & b(decimal) is %d /n",b); } 【程序52】
題目:學習使用按位或 。
1.程序分析:00=0; 01=1; 10=1; 11=1
2.程序源代碼:
#include "stdio.h" main() { int a,b; a=077; b=a3; printf("/40: The a & b(decimal) is %d /n",b); b=7; printf("/40: The a & b(decimal) is %d /n",b); } 【程序53】
題目:學習使用按位異或 ^ 。
1.程序分析:0^0=0; 0^1=1; 1^0=1; 1^1=0
2.程序源代碼:
#include "stdio.h" main() { 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); } 更多內容請看C/C++進階技術文檔 Wlan組網----家庭專題專題,或 【程序54】