C语言程序设计错题集
2019/03/06
1.下列程序段输出结果为:
int x=1, y=012;
printf(“%d”,y*x++);
A.20 B.10 C.12 D.24
2.以下表达式x&&1
用在if的条件中时,和哪个是等价的:
A.x!=1 B.x==0 C.x==1 D.x!=0
3.对于以下代码:
unsigned short sht = 0;
sht --;
执行后,sht的值是?
A.32767 B.-1 C.2的16次方-1 D.65536
4.对于以下代码:
int i=6;
if ( i<= 6 )
printf("hello\n");;
else
printf("bye-bye\n");;
哪句话是对的?
A.打印出"hello bye-bye" B.打印出"bye-bye" C.打印出"hello" D.无法编译
5.在代码:while ( !e )
中,!e等价于: