2017 2017秋C语言程序设计精髓(华东理工大学)(中国高校计算机教育MOOC联盟) 最新大学MOOC满分章节测试答案
- 第2周——数字间的那些事儿,做点计算哈 第2周测验
- define d 2
- define d 2
- include <math.h>
- include <stdlib.h>
- include <math.h>
- define EPS 1e-6
- include <math.h>
- include <math.h>
- include <math.h>
- include <stdlib.h>
- include <math.h>
- define EPS 1e-6
- include <math.h>
- include <stdio.h>
- include <stdio.h>
- include <math.h>
- define M 40
- define N 11
- define N 40
- include <time.h>
- include <stdio.h>
- define N 10
- define N 20
- define N 40
- include <math.h>
- include <stdio.h>
- define N 40
- define N 10
- define N 40
- include <time.h>
- include <stdio.h>
- define N 20
- define M 40
- define N 11
- include <stdio.h>
- include <math.h>
本答案对应课程为:点我自动跳转查看
本课程起止时间为:2017-10-10到2018-02-26
本篇答案更新状态:已完结
第2周——数字间的那些事儿,做点计算哈 第2周测验
1、 问题:下列程序的输出结果是#include <stdio.h>
int main()
{
int a=7,b=5;
printf("%d",b/a);
return 0;
}
选项:
A:0
B:5
C:1
D:0.7
答案: 【0】
2、 问题:下列关于单目运算符++、–的叙述中正确的是
选项:
A:a++的运算过程是:先使用变量a的值,然后再执行a=a+1。
B:++a的运算过程是:先使用变量a的值,然后再执行a=a+1。
C:a++的运算过程是:先执行a=a+1,然后再使用变量a的值。
D:a++和++a都是最终使变量a执行a=a+1,因此对于包含a++或++a的表达式而言(如j=a++;或者j=++a;),两种情况下表达式的最终运算结果一定是相同的。
答案: 【a++的运算过程是:先使用变量a的值,然后再执行a=a+1。】
3、 问题:以下程序的输出结果是:#include <stdio.h>
int main()
{
int a=1, b=2;
a=a+b;
b=a-b;
a=a-b;
printf("%d,%d", a, b );
return 0;
}
选项:
A:2,1
B:3,1
C:3,2
D:1,2
答案: 【2,1】
4、 问题:程序运行后的输出结果是#include <stdio.h>
int main()
{
int m=3,n=4,x;
x=m++;
++n;
x=x+8/n;
printf("%d,%d",x,m);
return 0;
}
选项:
A:4,4
B:4,3
C:5,4
D:5,3
答案: 【4,4】
5、 问题:下面程序的运行结果是#include <stdio.h>
int main()
{
int a = 2, b = 3 ;
float x = 3.5, y = 2.5 ;
printf("%f", (float)(a+b) / 2 + (int)x % (int)y) ;
return 0;
}
选项:
A:3.500000
B:3.000000
C:3.5
D:3
答案: 【3.500000】
6、 问题:以下非法的赋值语句是
选项:
A:++(i+1);
B:x=(j–);
C:n=++i;
D:j++;
答案: 【++(i+1);】
7、 问题:设a和b均为double型变量,且a=5.5、b=2.5,则表达式(int)a+b/b的值是
选项:
A:6.000000
B: 6.500000
C:6
D:5.500000
答案: 【6.000000】
8、 问题: 以下程序的运行结果是#include <stdio.h>
int main()
{
int a = 12, b = 3;
float x = 18.5, y = 4.5;
printf("%f", (float)(a * b) / 2);
printf("%d", (int)x %(int)y);
return 0;
}
选项:
A:18.0000002
B:182
C:182.000000
D:18.0000002.000000
答案: 【18.0000002】
9、 问题:设有语句“int a = 3;”,执行语句“a += a -= a * a;”后,变量a的值是
选项:
A:-12
B:3
C:0
D:9
答案: 【-12】
10、 问题:在C语言中,要求操作数必须是整型的运算符是
选项:
A:%
B:/
C:*
D:+
E:-
答案: 【%】
11、 问题:程序运行后的输出结果是#include <stdio.h>
int main()
{
char a=’a’;
printf("%c,",++a);
printf("%c",a++);
return 0;
}
选项:
A: b,b
B:b,c
C:a,b
D:a,c
答案: 【 b,b】
12、 问题:下面哪条语句可以生成0-9之间的随机数
选项:
A:magic=rand()%10;
B:magic=rand()%10+1;
C:magic=rand()/10;
D:magic=rand()/10+1;
答案: 【magic=rand()%10;】
13、 问题:在下面的C语言语句中,存在错误的是
选项:
A:int a=b=10;
B:int a=10,b=10;
C:int a,b;a=b=10;
D:int a,b;a=10;b=10;
答案: 【int a=b=10;】
14、 问题:若以下选项中的变量已正确定义,则正确的赋值语句是
选项:
A:x3=x2=x1=0;
B:x1=26.8%3;
C:1+2=x2;
D:x4=1+2=3;
答案: 【x3=x2=x1=0; 】
15、 问题:若有以下定义,则表达式“a * b + d – c”的值的类型为#include <stdio.h>
int main()
{
char a;
int b;
float c;
double d;
….
return 0;
}
选项:
A:double
B:int
C:float
D:char
答案: 【double】
16、 问题:在C程序中如果要使用数学函数,如sin(x),log(x)等,需要在程序中加入的语句是
选项:
A:#include <math.h>
B:#include <stdio.h>
C:#define <math.h>
D:#define <stdio.h>
本文章不含期末不含主观题!!
本文章不含期末不含主观题!!
支付后可长期查看
有疑问请添加客服QQ 2356025045反馈
如遇卡顿看不了请换个浏览器即可打开
请看清楚了再购买哦,电子资源购买后不支持退款哦