大学《C语言程序设计》期末考试编程题库及答案.doc

大学《C语言程序设计》期末考试编程题库及答案.doc

1 题目:根据下面的函数关系,对输入的每个x值,计算出相应的y值并输出结果。 #includestdio.h #includemath.h main() { float x,y; printf(“enter x:\n”); scanf(“%f”,x); if(x=0) y=0; else if(x=10) y=x; else y=0.5+sin(x); printf(“x=%f,y=%f\n”,x,y); } 2题目:输入一个整数,当为65时显示A,66时显示B,68时显示C,其他值时显示END。(可选用switch语句编写) #include stdio.h main() { int

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档