选择题
1.关于C语言语句的正确概念是______。正确答案是:goto语句可以从C语言中去除
2.C语言中的语句 #define R 20 用于定义 _____①_______ ,语句char r1; 则用于定义_____②_____ 。正确答案是:① 符号常量R ② 字符变量r1
3.
写出程序的运行结果。
#include <stdio.h>
main
{ int a, b;
scanf ( ”%d%d", &a, &b);
if ( ++a >= b ) printf( ”Yes”);
printf ( " a+b =%d\n", a+b );
}
如果输入:a=6,b=8,则输出结果是___________。
4.
写出程序的运行结果。
main
{ int a=0;
for ( a=0;a<3;a++ );
printf ( " %d\n", a );
}
输出结果是___________。
5.
写出程序的运行结果。
#include <stdio.h>
main
{ int i=0,j=0,k=0,m;
for ( m=0;m<4;m++ )
switch ( m )
{ case 0:i=m++;
case 1:j=m++;
case 2:k=m++;
case 3:m++;
}
printf ("\n%d,%d,%d,%d",i,j,k,m);
}
该程序的执行结果是______。
6.
写出程序的运行结果。
#include <stdio.h>
main()
{ int j;
for(j=0;j<10;j++)
{if (j%2==0) continue;
printf("%d",j);
}
}
该程序的执行结果是___________。