首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
专升本
若有定义:float w;int a,b;则合法的switch语句是( )。
若有定义:float w;int a,b;则合法的switch语句是( )。
admin
2014-10-20
26
问题
若有定义:float w;int a,b;则合法的switch语句是( )。
选项
A、switch(w)
B、switch(a);
{case 1.0:printf(“*\n”); {case 1 printf(“*\n”);
case 2.0:printf(“**\n”);case 2 printf(“**\n”);
}}
C、switch(b)
D、switch(a+b);
{case 1:printf(“*\n”);{case 1:printf(“*\n”);
default:printf(“\n”);case 2:printf(“**\n”);
case 1+2:printf(“**\n”);default:printf(“\n”);
}}
答案
C
解析
A项switch后面的表达式不能为浮点型表达式,一般为整型或字符型。B、D,switch后面有;不满足switch的规则。只有C,default可以在case前也可以在其后,故选C。
转载请注明原文地址:https://jikaoti.com/ti/vw9fFFFM
本试题收录于:
计算机科学与技术题库普高专升本分类
0
计算机科学与技术
普高专升本
相关试题推荐
在体循环中,血流速度最快的是()。
下列服药的方法正确的是()。
如下图所示各结构弯矩图的形状正确的是()
下图所示四结构,柱子的刚度、高度相同,横梁刚度为无穷大,质量集中在横梁上。它们的自振频率自左至右分别为ω1、ω2、ω3、ω4,那么它们的关系是()
广义之“精”,泛指人体中的:
鼻咽癌的组织学类型中,以哪一种最为多见()
下列哪种类型为不累及肺泡的肺气肿()
模板DNA的碱基序列是3’一LTGCAGT-5’,其转录出RNA碱基序列是:()
不能对二维数组a进行正确初始化的语句是()。
已知散列表地址空间为HT[0..8],散列函数为H(key)=key%7,采用线性探测法处理冲突,将数据序列{107,27,28,42,3,25,99,38}依次存入散列表中。试画出相应的散列表;并计算等概率下搜索成功的平均搜索长度。散列表及其查找各关键字
随机试题
根据《行政复议法》规定,只要认为行政机关违法集资、征收财物、摊派费用或者违法要求履行其他义务的,就可以申请行政复议。()
A、脑膜、脑脊液B、脑膜、脑实质C、脑膜、脑实质、部分脑室、脑脊液D、脑膜、脑实质、部分脑室,无脑脊液E、脑膜、部分脑室显性颅裂中囊状脑膜脑膨出的内容物是()
重症肌无力的病变部位在
监理工程师在设备试运行过程的质量控制任务主要是()。
下列项目中,不属于企业所得税优惠政策的是()。
总分类账户和明细分类账户平行登记的要点包括()。
在实际的教育和教学过程中,引导学生分辨勇敢和鲁莽、谦让和退缩,要求学生区别重力和压力,质量和重量等,需要对刺激进行()。
学生在新课程中,既是课程资源的消费者,又是课程资源的开发者。()
举例说明,P、V操作为什么要求设计成原语(即对同一信号量上的操作必须互斥)。P(S)操作:S.value一一;if(S.value
文某在商场购物时,其携带的1000元被武某偷走。商场保安人员发现这一情况未加制止。则下列表述正确的是()。
最新回复
(
0
)