mooc第五章测验错题
2下列程序段输出结果为:
int x=1, y=012;printf(“%d”,y*x++);
A.20 B.12 C.10 D.24
3下面程序段的输出结果是?int k;while(k!=0) k=k-1;printf(“%d”, k); **A.**无论k的初值如何,最终都会减到0的。
B.因为没有给k赋初值,因此程序不能通过编译
C.1
D.因为k没有初值,所以结果不确定
4对于以下代码: unsigned short sht = 0; sht --;执行后,sht的值是? 得分/总分 A.-1 B.2的16次方-1 C.32767 D.65536
5对于以下代码: int i=6; if ( i<= 6 ) printf(“hello\n”);; else printf(“bye-bye\n”);;哪句话是对的?
A.打印出"bye-bye"
**B.**不能通过编译
C.打印出"hello bye-bye"
D.打印出"hello"
6下列可用于C语言程序标识符的一组是(名字间以逗号分隔): 得分/总分
A.void,_2a, 2a
B.For, -abc, IF
C._if, _123, file
D.void, d, WORD
13以下代码段的结果是:
int i=10;
long long t = sizeof(i++);
printf("%d", i);
10
7.对于以下代码: char ch = -1; printf("%d\n", ch);
输出结果是?
A.编译错误,因为赋值的时候类型不一致
B.ASCII码表中255那个位置的字符
C.-1
D.255
3113

被折叠的 条评论
为什么被折叠?



