程序设计基础 ——C语言 上机指导参考答案.docVIP

  • 210
  • 8
  • 约2.92万字
  • 约 61页
  • 2016-03-06 发布于辽宁
  • 举报

程序设计基础 ——C语言 上机指导参考答案.doc

上机1 参考答案 三、 2. 程序输出结果是: Hello, C! Sum is 90 4. 程序输出结果是: Hello,World! Welcome to the C language world! Everyone has been waiting for. 5. #include stdio.h int main () { printf(****************************\n); printf( Hello,World! \n);printf(****************************\n); return 0; } 6. (1)error C2065: a : undeclared identifiererror C2065: b : undeclared identifier error C2065: c : undeclared identifier (2)没有错误。 刚才的错误是:a,b,c没有定义 (3)没有显示结果修改程序,main函数的最后一行增加一条语句:printf(“%d\n”,c); (4)有显示结果。输出:7 1.(1)平均值为:0.000000 原因是:x,y和z都是整数,则(x+y+z)/3时,即整数与整数除法得到的结果是取整。 (2)平均值为:0.666667 (3

文档评论(0)

1亿VIP精品文档

相关文档