首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include main() { int i, s=0, t[]={1,2,3,4,5,6,7,8,9}; for(i=0;i
有以下程序 #include main() { int i, s=0, t[]={1,2,3,4,5,6,7,8,9}; for(i=0;i
admin
2020-03-15
20
问题
有以下程序
#include
main()
{ int i, s=0, t[]={1,2,3,4,5,6,7,8,9};
for(i=0;i<9;i+=2) s+=*(t+i);
printf("%d\n",s);
}
程序执行后的输出结果是( )。
选项
A、25
B、20
C、45
D、36
答案
A
解析
数组名t为一个地址常量,表示的是数组t的首地址,所以*(t+i)与t
等价,s统计的为数组t中下标为偶数的元素的和,计算结果为25,答案选A。
转载请注明原文地址:https://kaotiyun.com/show/iCCp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
以下叙述中正确的是
有下列程序,程序的运行结果是#include#defineN5#defineMN+1#definefix)(x*M)main(){inti1,i2;il=ff2);
关于算法,以下叙述中错误的是
以下叙述中错误的是
下列叙述中错误的是
以下不构成无限循环的语句或语句组是
关于do循环体while(条件表达式);以下叙述中正确的是
下面选项中关于“文件指针”概念的叙述正确的是
以下选项中,当x为大于1的奇数时,值为0的表达式是
随机试题
分布式数据库的【13】透明性是最高级别的透明性,它使得在编写程序时用户只需要对全局关系进行操作,这样简化了应用程序的维护。
2009年1月27日,中国南极科学考察队在南极内陆冰盖的最高点冰穹A地区,胜利建成中国首个南极内陆科考部并命名为()
设f(χ)=e2χ,则f(2015)(0)=_________。
白疤的皮损特征风热疮的皮损特征
根据《关于加强城市总体规划修编和审批的工作的通知》的规定,总体规划的修编工作应当按照一定的要求进行,该要求不包括()
[背景资料]某新建图书馆工程,采用公开招标的方式,确定某施工单位中标,双方按《建设工程施工合同(示范文本)》(GF—2013—0201)签订了施工总承包合同。合同约定总造价14250万元,预付备料款2800万元,每月底按月支付施工进度款。竣工结算时,结算
纸制扑克牌
关于劳动力市场均衡的说法,正确的是()。
幼儿书包的重量不应超过幼儿体重的()。
公司全部资产减去公司全部负债的余额是()。
最新回复
(
0
)