首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
现有如下程序段 #include"stdio.h" main() { int k[30]={12,324,45,6,768,98,21,34,453,456}; int count=0,i=0; while(k[
现有如下程序段 #include"stdio.h" main() { int k[30]={12,324,45,6,768,98,21,34,453,456}; int count=0,i=0; while(k[
admin
2009-02-15
12
问题
现有如下程序段 #include"stdio.h" main() { int k[30]={12,324,45,6,768,98,21,34,453,456}; int count=0,i=0; while(k
) { if(k
%2==0||k
%5==0)count++; i++; } printf("%d,%d\n",count,i);} 则程序段的输出结果为
选项
A、7,8
B、8,8
C、7,10
D、8,10
答案
8
解析
在C语言中,定义一维数组的语句一般形式如下:
类型名 数组名[常量表达式];
一维数组的引用形式为:数组名[下标表达式]。 count表示能被2整除或被5整除的个数,i则计算有多少个数组元素。
转载请注明原文地址:https://kaotiyun.com/show/cfXp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
编写如下程序:PrivateSubCommandl_Click()DimaAsInteger,bAsIntegera=3b=2Ifa*b<10Thenb=b+1Elseb=b-1
在窗体上画一个文本框,其名称为Text1,然后编写以下程序:PrivateSubForm_Load()ShowText1.Text=""Text1.SetFoeusEndSubPrivat
在快速排序法中,每经过一次数据交换(或移动)后()。
窗体上有名称为Listl的列表框。以下能够将列表框当前选定的列表项替换为字符串“Basic”的语句是()。
窗体上有1个名称为Commandl的命令按钮,事件过程如下:PrivateSubCommandl_Click()m=-3.6IfSgn(m)Thenn=Int(m)Elsen=Abs(m)
在窗体上画一个名称为List1的列表框,然后编写如下程序:PrivateSubForm_Click()Fori=1To10Item="Item"&iList1.AddItemItemNexti
单击窗体,可以弹出如图所示对话框的程序为()。
定义学生选修课程的关系横式如下:S(S#,Sn,Sd,Sa)(其属性分别为学号、姓名、所在系、年龄);C(C#,Cn,P#)(其属性分别为课程号、课程名、先选课);SC(S#,C#,G)(其属性分别学号、课号和成绩)。
已知A$="Welcome",下列语句操作能够正确执行的是()。
随机试题
对胸部外伤的表述,正确的是
利多卡因作阻滞局麻时的常用浓度是
哪些情况下可以简易程序不可以一审终审()
压力表与表管之间装设三通旋塞阀的目的是()。
某企业在2011年终财务分析中发现人工成本比去年增加了5%,人力资源部对企业的各种人工费用进行了分析。根据以上资料,回答下列问题:分析发现自己企业福利开支占人工总成本比例过高,对此,下列说法不正确的有()。
企业购买或租用的生产要素所实际支付的货币支出是()。
下列哪些人可以提出宣告发明专利权全部无效的请求?
某篮球队主教练规定,如果一号上场,而且三号队员没有上场,那么,五号与七号队员中至少要有一人上场。如果主教练的规定被贯彻执行了,一号队员没有上场的充分条件是()。
基于构件的软件开发中,构件分类方法可以归纳为三大类:(35)________根据领域分析的结果将应用领域的概念按照从抽象到具体的顺序逐次分解为树形或有向无回路图结构;(36)________利用Facet描述构件执行的功能、被操作的数据、构件应用的语境或
Elderlypeoplerespondbesttoacalmandunhurriedenvironment.Thisisnotalwayseasyto【B1】______astheirbehaviorcansomet
最新回复
(
0
)