《精》二级教材参考答案.docVIP

  • 36
  • 0
  • 约2.53万字
  • 约 38页
  • 2017-01-16 发布于北京
  • 举报
三、上机改错题请指出以下C程序的错误所在 #include stdio.h ; main( ); / * main function * / float r, s; /* /*r is radius*/,/*s is area of circular*/*/ r = 5.0 ; s=3.14159 * r * r ; printf(%f\n,s); ※正确应为: #include 或 #includestdio.h main( ) /* main function */ { float r,s; /*r is radius, s is area of circular*/ r = 5.0 ; s = 3.14159 * r * r ; printf(%f\n,s); } (2.25) 请指出以下C程序的错误所在 #include stdio.h main /* main function */ { float a,b,c,v; /*a,b,c are sides, v is volume of cube*/ a = 2.0 ; b = 3.0 ; c = 4.0 v = a * b * c; printf(%f\n,v); } ※正确应为: #includestdio.h main( ) /* main function */ { float a,b,c,v; /*a,b,c

文档评论(0)

1亿VIP精品文档

相关文档