do...while语句的循环体至少执行1次,while和for循环的循环体可能一次也不执行。(5.0)
查看答案
以下程序的输出结果是 。#include main(){ int x=0,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=1,b=1
B. a=2,b=2
C. a=2,b=1
D. a=1,b=0
C 语言中的 switch 语句中
A. 必须有break语句
B. 必须有default分支
C. 必须把default分支放在case分支后边
D. default分支可以有,也可以没有
以下程序输出的结果是()# include int main(){int a = 4;switch(a ){case 0:printf("this is 0\n");break;case 1:printf("this is 1\n");break;case 2:printf("this is 2\n");break;default:printf("this is default\n");}return 0;}
A. this is 1
B. this is default
C. this is 2
D. this is 0
switch()语句适合条件分支比较少的情况。
A. 对
B. 错