if程序设计.pptVIP

  • 0
  • 0
  • 约2.08千字
  • 约 17页
  • 2016-12-21 发布于河南
  • 举报
C语言程序设计 认真观察程序运行过程和程序的运行结果: 【案例一】:根据输入的数选择执行显示操作。如果输入的是正数,在屏幕上显示“输入的数大于零”;如果输入的数是负数或零,则不显示这条信息。 【案例二】: #includestdio.h  void main()  {  int a=1,b=2,c=3;  if(ac)  b=a; a=c; c=b;  printf(“a=%d,b=%d,c=%d\n”,a,b,c);  } 4、根据流程图写出如下程序:   #includestdio.h void main( ) { float x; printf(“please input a number:”); scanf(“%f”,x); if(x0) { x=4*x; printf(“the result is:%f\n”,x); } } * * * * * * * * * * * * * * * * * * 如果成绩在80分以上,就提出表扬 if 成绩80 printf(“非常棒”) “如果……就……”对应c程序中的描述

文档评论(0)

1亿VIP精品文档

相关文档