C语言程序设计 智慧树 知到 前两章答案 2020

第一章 单元测试

1、判断题:
构成c程序的基本单位是函数,有且只有一个主函数
选项:
A:对
B:错
答案: 【对】

2、判断题:
c语言一行可以写多条语句
选项:
A:错
B:对
答案: 【对】

第二章 单元测试

1、单选题:
以下选项中可用作C程序合法实数的是
选项:
A:9.12E
B:3.0e0.2
C:E9
D:0.1e0
答案: 【0.1e0】

2、单选题:
以下程序的输出结果是

#include <stdio.h>
main()
{
	int x=10,y=10;printf("%d %d ",x--,--y);
}

选项:
A:9 10
B:10 10
C:10 9
D:9 9
答案: 【10 9】

3、单选题:
若有定义语句:int a=3,b=2,c=1;,以下选项中错误的赋值表达式是
选项:
A:a=(b=4)=3;
B:a=1+(b=c=4);
C:a=(b=4)+c;
D:a=b=c+1;
答案: 【a=(b=4)=3;】

4、单选题:
写出下面程序的运行结果:

#include <stdio.h>
void main( )
{
int x,y,z;
x=y=1;
z=x++,y++,++y;
printf("%d,%d,%d ",x,y,z);
}

选项:
A:2,2,1
B:2,2,3
C:2,3,1
D:1,1,1
答案: 【2,3,1】

5、单选题:
写出下面程序的运行结果:

#include <stdio.h>
void main( )
{
	int a=1,b=0;
	printf("%d,",b=a+b);
	printf("%d",a=2*b);
}

选项:
A:2,2
B:3,2
C:1,1
D:1,2
答案: 【1,2】

6、单选题:
写出下面程序的运行结果:

main()
{
	int a,b,c=9;
	a=3,b=4;
	c%= a+b;
	printf(%d”,c)
} 

选项:
A:3
B:2
C:1
D:4
答案: 【2】

7、单选题:
写出下面程序的运行结果:

#include <stdio.h>     
main()
{
	int a=4,b,c;
	c=a+(b=2);
	a+=a-=a*a;
	printf("%d,%d,%d ",a,b,c);
}

选项:
A:-12,2,6
B:4,2,6
C:-24,2,6
D:-8,2,6
答案: 【-24,2,6】

发布了81 篇原创文章 · 获赞 83 · 访问量 1510

猜你喜欢

转载自blog.csdn.net/qq_43133192/article/details/105148933
今日推荐