单项选择题
有以下程序:
#include <stdio.h>
main()
int i;
for(i=0; i<3; i++)
switch(i)
case 0: printf("%d", i);
case 2:printf("%d", i);
default: printf("%d", i);
程序运行后的输出结果是( )。
A) 022111
B) 021021
C) 000122
D) 012
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序: #include <stdio.h> main() char k; int i; for(i=1; i<3; i++) scanf( %c ,&k); switch(k) case '0': printf( another n ); case '1': printf( number n ); 程序运行时,从键盘输入:01<回车>,程序执行后的输出结果是( )。
A) another
number
B) another
number
another
C) another
number
number
D) number
number
点击查看答案&解析
单项选择题
在嵌套使用if语句时,C语言规定else总是( )。
A) 和之前与其具有相同缩进位置的if配对
B) 和之前与其最近的if配对
C) 和之前与其最近的且不带else的if配对
D) 和之前的第一个if配对
点击查看答案&解析
相关试题
以下叙述中错误的是( )。
表达式0x13&0x17的值是( )。
设有以下语句: char x=3, y=6, ...
有以下程序: #include <stdio.h> i...
以下程序的输出结果是( )。 #include...