2009年9月全国计算机等级考试二级C语言程序设计题(46)
来源:优易学  2011-7-30 16:19:52   【优易学:中国教育考试门户网】   资料下载   IT书店
题目:宏#define命令练习(1)
  1.程序分析:
  2.程序源代码:
  #include "stdio.h"
  #define TRUE 1
  #define FALSE 0
  #define SQ(x) (x)*(x)
  void main()
  {
  int num;
  int again=1;
  printf("\40: Program will stop if input value less than 50.\n");
  while(again)
  {
  printf("\40:Please input number==>");
  scanf("%d",&num);
  printf("\40:The square for this number is %d \n",SQ(num));
  if(num>=50)
  again=TRUE;
  else
  again=FALSE;
  }
  }

责任编辑:小草

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