以下程序的输出结果是( )。void main(){int x=1, a=0, b=0;switch(x){case 0: b++;case 1: a++;case 2: a++; b++;}printf(“a=%d,b=%d\n”,a,b); }
A. a=2,b=1
B. a=1,b=1
C. a=1,b=0
D. a=2,b=2
查看答案
以下循环语句的执行次数是( )。for(i=2;i!=0; i--) printf(“%d”,i);
A. 无限次
B. 0次
C. 1次
D. 2次
可将for(表达式1; ;表达式3)理解为( )。
A. for(表达式1;0 ;表达式3)
B. for(表达式1;1 ;表达式3)
C. for(表达式1;表达式1 ;表达式3)
D. for(表达式1;表达式3 ;表达式3)
以下程序段中,while循环的循环次数是( )。int i=0;while(i<10){if(i<5) continue;if(i==5) break;i++;}
A. 1
B. 10
C. 死循环
D. 有语法错误
Replace the underlined parts with proper expressions.Have you ever been there by bus?
A. taken a bus there
B. gone there on bus
C. went there on a bus