首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的输出结果是______. #include <stdio.h> fun () { static int a=O; a+=3; printf("%d",a); } main () { int
下列程序的输出结果是______. #include <stdio.h> fun () { static int a=O; a+=3; printf("%d",a); } main () { int
admin
2010-05-22
19
问题
下列程序的输出结果是______.
#include <stdio.h>
fun ()
{ static int a=O;
a+=3; printf("%d",a);
}
main ()
{ int cc;
for (cc=1;cc<5;cc++) fun();
printf ("\n");
}
选项
答案
3 6 9 12
解析
本题考查最基本的for循环:for(cc=1;cc<5;cc++)规定循环次数为4次,每次a+=3即每次a的值增3,但因为fun函数中变量 a为static类型,所以每次调用完子函数之后,变量a所做的改变都要保存。
转载请注明原文地址:https://kaotiyun.com/show/TAWp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
设窗体上有3个图像框:Image1、Image2、Image3,并有下面的程序代码:PrivateSubForm_Load()Image1.Picture=LoadPicture(”LEAF.bmp”)Image2.Pict
在标准模块中,将a定义为全局整型变量的语句是()。
在窗体上画一个水平滚动条,其属性值满足Min<Max。程序运行后,如果单击滚动条右端的箭头,则Value属性值()。
结构化程序的三种基本控制结构是()。
已知图片框Picture1中已装入一个图形,为了在不删除图片框的前提下,清除该图形,应采取的正确操作是()。
关系数据模型的三个组成部分中不包括()。
设循环队列的存储空间为Q(1:50),初始状态为front=rear=50。现经过一系列入队与退队操作后,front=rear=1,此后又正常地插入了两个元素。最后该队列中的元素个数为()。
VisualBasic中的“启动对象”是指启动VisualBasic应用程序时,被自动加载并首先执行的对象。下列关于VisualBasic“启动对象”的描述中,错误的是()。
已知数组Dima(1To10)AsInteger,则下面正确调用GetValue函数的是()。PrivateFunctionGetValue(a()AsInteger)AsIntegerFori=1To10GetValue=G
源程序中应包含一些内部文档,以帮助阅读和理解程序,源程序的内部文档通常包括选择合适的标识符、注释和
随机试题
基于连通器原理的液位计是()。
患者,男性,55岁,黑便3天,查体:P110次/分,BP90/75mmHg,腹部查体阴性,经胃镜检查,为十二指肠球部出血。入院1周后,突发呕血2200ml,伴柏油样大便。查体呈休克状态,BP85/50mmHg,P118次/分,最合适的治疗
商检机构检验合格的出口商品,发货人应当在检验证书或者放行单签发之日起( )内报运出口。
会计电算化软件的来源主要有()。
在有些情况下,注册会计师出于对成本效益原则的考虑并不一定选取最有力的证据。( )
根据我国现行宪法规定.担任下列哪一职务的人员,应由国家主席根据全国人大和全国人大常委会的决定予以任免?
Whatarethetwospeakersgoingtodothisevening?
Ifyourexpenses______yourincome,youwillbeindebt.
Depressionthatinflictspeoplewhobelievetheirliveslackcontentwhentherushofthebusyweekstopsreferredtobyapromi
A.necessityB.hangingonC.periodD.improvingE.haltedF.botheredG.reasons
最新回复
(
0
)