A-A+

若有定义:float x=1.5;int a=1 b=3 c=2;则正确的switch语句是

2022-08-06 04:06:49 问答库 阅读 175 次

问题详情

若有定义:float x=1.5;int a=1,b=3,c=2;则正确的switch语句是()。
A.switch(x) {case 1.0:printf("*n"); case 2.0:printf("**n");}
B.switch((int)x); {case 1:printf("*n"); case 2:printf("**n");}
C.switch(a+B){case 1:printf("*n"); case 2+1:printf("**n");}
D.switch(a+B){case 1:printf("*n"); case c:printf("**n");)请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:C

考点:语句,定义