2009年9月全国计算机等级考试二级C语言程序设计题(55)
来源:优易学  2011-7-30 16:24:39   【优易学:中国教育考试门户网】   资料下载   IT书店
题目:学习使用按位取反~。
  1.程序分析:~0=1; ~1=0;
  2.程序源代码:
  #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);
  }

责任编辑:小草

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训