首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include <stdio.h> main() { char k; int i; for(i=1;i<3;i++) { scanf("%c",&k); switch(k)
有以下程序: #include <stdio.h> main() { char k; int i; for(i=1;i<3;i++) { scanf("%c",&k); switch(k)
admin
2009-01-15
18
问题
有以下程序: #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
D、number number
答案
4
解析
本题中没有使用break终止switch语句的执行,当k为’0’时,执行完case ’0’后的输出后将继续执行case ’1’后的输出;当k为’1’时,执行case ’1’后的输出。
转载请注明原文地址:https://kaotiyun.com/show/jpHp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
在考生文件夹下有一个工程文件sil5.vbp,在窗体上给出了所有控件和不完整的程序,请去掉程序中的注释符,把程序中的“?”改为正确的内容。本程序的功能是:如果单击“取数”按钮,则把考生目录下的in5.txt文件中的15个姓名读到数组a中,并在窗体上显示这些
请根据以下各小题的要求设计visualBasic应用程序(包括界面和代码)。在名称为Form1的窗体上画一个名称check1的复选框数组(Index属性从0开始),含三个复选框,其标题分别为“语文”、“数学”、“体育”,利用属性窗口设置适当的属性,使
在名称为Form1的窗体上添加一个名称为Text1的文本框;再建立一个下拉菜单,菜单标题为“操作”,名称为M1,此菜单下含有两个菜单项,名称分别为Show和Hide,标题分别为“显示”、“隐藏”,请编写适当的事件过程,使程序运行时,单击“隐藏”菜单项,文本
请根据以下各小题的要求设计VisualBasic应用程序(包括界面和代码)。在名称为Forml的窗体上画一个名称为Labell、标题为”列表框的使用”的标签。再画一个名称为Listl的列表框,列表中含有5个表项,表项内容分别为”北京”、“山西”、”
请根据以下各小题的要求设计VisualBasic应用程序(包括界面和代码)。(1)在名称为Form1、标题为“欢迎”的窗体上画1个名称为Label1的标签,其标题内容为“欢迎使用本系统”,标题文字字体和字号分别为“宋体”、“三号”,标签大小能根据标题内
(1)在标题为“列表框”、名称为Form1的窗体上添加一个名称为List1的列表框,通过属性窗口输入4个列表项:“数学”、“语文”、“历史”、“地理”,列表项形式采用复选框形式,如图所示。列表框的宽为1100,高不限。注意:存盘时必须存放在考生文
在考生文件夹下,存在两个数据库文件和一个照片文件,数据库文件名分别为“samp1.accdb”和“dResearch.accdb”,照片文件名为“照片.bmp”。请按以下操作要求,完成表的建立和修改。(1)将考生文件夹下“dResearch.ac
关系的实体完整性要求关系中不能为空的属性是()。
已知:x=-6y=39则表达式“y\x*Sgn(x)”的值为
为达到把a、b中的值交换后输出的目的,某人编程如下:PrivateSubCommandl_Click()a%=10:b%=20Callswap(a,b)Printa,bEndSubPrivateSubswap
随机试题
甲从A地购得面值2万元的假币,然后携带假币乘坐火车到B地。甲在车上与几个朋友赌博时被乘警发现,乘警按规定对甲处以罚款,甲欺骗乘警,以假币缴纳罚款,被乘警发现。甲的行为构成下列哪些罪?()(2003年卷二第34题)
下列需要编制环境影响报告书的规划的是:
()可以对期货投资者保障基金的规模、缴纳比例和缴纳方式进行调整。[2012年9月真题]
甲企业以已经出租的办公楼为抵押,向乙银行借款;抵押权设立后,乙银行可以办公楼抵押权对抗其租赁权。()
神经衰弱的常见生理症状包括()。
北宋张择端的一幅反映当时社会生活的风俗画,有很高的艺术价值和史料价值的作品是(),
张老师说:这次摸底考试,我们班的学生全都通过了,所以,没有通过的都不是我们班的学生。以下哪项和以上推理最为相似?
习近平在纪念邓小平同志诞辰110周年座谈会上的讲话中指出:中国特色社会主义是适合中国国情、符合中国特点、顺应时代发展要求的理论和实践,所以才能取得成功,并将继续取得成功。中华民族创造了具有5000多年悠久历史的辉煌文明,中国人民在中国共产党领导下创造了建
[*]
A、Itallowshimtomakealotoffriends.B、Itrequireshimtoworklonghours.C、Itenableshimtoapplytheorytopractice.D、
最新回复
(
0
)