A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

© normalwzh 中级黑马   /  2015-11-10 17:53  /  696 人查看  /  0 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

题目:学习使用按位取反~。   
1.程序分析:~0=1; ~1=0;
2.程序源代码:
i nclude "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);
}

您需要登录后才可以回帖 登录 | 加入黑马