单选题:以下程序的执行结果是 ____
以下程序的执行结果是()
int main()
{ char x='B';
switch(x)
{ case ‘A’: printf(“It is A.”);
case ‘B’: printf(“It is B.”);
case ‘C’: printf(“It is C.”);
default: printf(“other.”);
}
return 0;
}
A.It is B.
B.It is B.
It is C.
other.
C.It is A.
It is B.
It is C.
other.
D.It is B.It is C.other.
答案:D
int main()
{ char x='B';
switch(x)
{ case ‘A’: printf(“It is A.”);
case ‘B’: printf(“It is B.”);
case ‘C’: printf(“It is C.”);
default: printf(“other.”);
}
return 0;
}
A.It is B.
B.It is B.
It is C.
other.
C.It is A.
It is B.
It is C.
other.
D.It is B.It is C.other.
答案:D