首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include<stdio.h> main() { char c[6]; int i=0; for(j<6;c[i]=getchar(),i++);
有以下程序: #include<stdio.h> main() { char c[6]; int i=0; for(j<6;c[i]=getchar(),i++);
admin
2010-09-05
17
问题
有以下程序: #include<stdio.h> main() { char c[6]; int i=0; for(j<6;c
=getchar(),i++); for(i=0,i<6;i++)putchar(c
); printf("\n"); } 如果从键盘上输入: ab<回车> c<回车> def<回车> 则输出结果为______。
选项
A、a b c d e f
B、a b c d
C、ab c d
D、abcdef
答案
C
解析
getchar():此函数的作用是从终端(或系统隐含指定的输入设备)输入—个字符。 2.putchar()此函数的作用是向终端输出—个字符,也可以输出控制字符。本题在输入字符时,ab和c后面的回车符分别赋给了c[2]和c[4],所以,正确答案为C。
转载请注明原文地址:https://kaotiyun.com/show/JdWp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
在考生文件夹下有一个工程文件sjt5.vbp,功能是用来计算勾股定理整数组合的个数。勾股定理中3个数的关系是:a2+b2=c2。例如,3、4、5就是一个满足条件的整数组合(注意:a,b,c分别为4,3,5与分别为3,4,5被视为同一个组合,不应该重复计算)
下列程序的执行结果为()。n=0j=1DoUntiln>2n=n+1:j=j+n*(n+1)LoopPrintn;i
VB中,若没有显式声明变量的数据类型,则默认的类型是
下列数据结构中,能够按照"先进后出"原则存取数据的是( )。
下列关于算法的描述中错误的是
设已经在菜单编辑器中设计了弹出式菜单mnuStyle,要求程序运行时,当用户在文本框Text1上单击鼠标右键时,能够弹出该菜单,则应使用的事件过程是()。
在考生文件夹中有一个工程文件sjt3.vbp。运行程序时,先向文本框Text1中输入一个不超过10的正整数,然后选择“N的阶乘”或“(N+2)的阶乘”单选钮,即可进行计算,计算结果在文本框Text2中显示,如图所示。在给出的窗体文件中已经添加了全部控件,但
下列关于C语言用户标识符的叙述中正确的是
在结构化程序设计中,模块划分的原则是()。
随机试题
A.腹部柔韧有抵抗力B.腹壁明显紧张,强直如板C.前腹壁水平明显低下,肋弓和耻骨联合显露D.腹部静脉迂曲变粗,显而易见E.左腰部皮肤呈暗灰蓝色胃穿孔可出现的体征是()
Only11people______theshipwreck.
男性,48岁,无明显诱因出现皮肤黏膜黄染、逐渐加重,皮肤瘙痒,大便呈浅灰色,查体:巩膜黄绿色,心肺听诊正常,腹软、无压痛、肝肋下2cm,Ⅱ度硬,脾未触及,实验室检查:血中结合胆红素明显增加,血清碱性磷酸酶活性增高,最可能的诊断是
(2008年多项选择第54题)资产负债表是反映企业在会计期末财务状况的报表,通过资产负债表可以了解企业的()。
据《论语·述而》记载,“子以四教:文、行、忠、信。”“‘诗、书、礼、易、乐、春秋”属于“四教”中的()。
能有效地提高幼儿认识、情感、意志与行为水平且能充分发挥幼儿主体作用的教育方法是()
摩擦:物体:热量
设矩阵A=,B为某个三阶非零矩阵,且AB=0,则t的值等于[].
若幂级数的收敛区间为(一27,27),则幂级数的收敛半径为_____.
合同一般是由要约和承诺构成。以下选项对于电子合同的要约叙述不正确的是()。
最新回复
(
0
)