首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #inclUde main() {int x=1。y=0; if(!x)y++; else if(x==0) if(x)y+=2; else y+=3; . prin
有以下程序 #inclUde main() {int x=1。y=0; if(!x)y++; else if(x==0) if(x)y+=2; else y+=3; . prin
admin
2011-04-29
33
问题
有以下程序
#inclUde
main()
{int x=1。y=0;
if(!x)y++;
else if(x==0)
if(x)y+=2;
else y+=3; .
printf(“%d\n”,y);
}
程序运行后的输出结果是
选项
A、3
B、2
C、1
D、0
答案
D
解析
本题主要考查的知识点为if语句的嵌套.变量x的值(为1。既不满址表达式!x为真.也不满足表达式x==0.故不执行if语句,而直接执行printf函数输出y的值0。
转载请注明原文地址:https://kaotiyun.com/show/UPPp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
窗体上的三个命令按钮构成名称为Command1的控件数组。如图所示。程序如下:PrivmeSubCommand1_Click(IndexAsInteger)IfIndex=1Theri
用来设置文字字体是否斜体的属性是()。
在长度为n的有序线性表中进行二分查找,最坏情况下需要比较的次数是()。
函数fun如下:PrivateFunctionfun(chAsString)AsIntegerDimn%,st$,c$Fork=1ToLen(ch)c=Mid(ch,k
以下叙述中,错误的是()。
下面有关标准模块的叙述中,错误的是()。
若有以下说明和定义 typedefint * INTEGER; INTEGER p,* q; 以下叙述正确的是
以下能正确定义数组并正确赋初值的语句是
用树形结构来表示实体之间联系的模型称为()。
随机试题
敲钟人卡西莫多的形象出自文学大师雨果创作的()。
骨骼摄影距离的最佳选择是
患者腹大坚满,胸脘痞闷,烦热口苦,身目发黄,小便短赤,大便干结,舌红苔黄腻,脉弦数。其证型是
用药咨询是药师应用所掌握的药学知识和药品信息,承接公众对药物治疗和合理用药的咨询服务,对临床合理用药有关键性作用。根据药物咨询对象的不同,可以将其分为患者、医师、护士和公众的用药咨询。下列多由患者提出的用药咨询内容是()。
2011年9月1日,某法院受理了湘江服装公司的破产申请并指定了管理人,管理人开始受理债权申报。下列哪些请求权属于可以申报的债权?
世界银行贷款对已订立贷款契约而未使用的部分,要按年征收( )的承诺费。
ABC公司下设A、B两个投资中心,A投资中心的平均净经营资产为700万元,部门投资报酬率为20%;B投资中心的部门投资报酬率为22%,剩余收益为105万元;ABC公司对A中心要求的平均最低部门税前投资报酬率为15%,对B中心要求的平均最低部门税前投资报酬率
下列不属于佛教四大名山的是()。
下关于查询的描述正确的是______。
Theteacher’svoicewassopleasantthatthelittleboyfeltat______withheratonce.
最新回复
(
0
)