济南大学C语言实验答案.pdfVIP

  • 30
  • 0
  • 约2.34万字
  • 约 25页
  • 2019-02-22 发布于广东
  • 举报
实验 顺序结构程序设计 2 1. 编写程序,从键盘输入一个大写字母,将它转换为对应的小写字母后输出。 参考程序: #include stdio.h void main() { charch; printf(“\nPlease input a capitalcharacter:”); scanf(“%c”,ch); ch ch+32; printf(“\nThe small letter is %c”,ch); } 2 r .编写程序,输入圆半径 ,求圆周长、圆面积、圆球体积。 参考程序: #include stdio.h #include math.h #define PI3.14 void main() { float r,c,area,v; printf(“\nPlease input the r:”); scanf(“%f”,r); c 2*PI*r; area PI*r*r; v 4.0/3*PI*pow(r,3); printf(“\nThe circle’s perimeter is %.2f”,c);

文档评论(0)

1亿VIP精品文档

相关文档