首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 main() { int t=1,i=5; for( ; i>=0; i--) t*=i; printf("%d\n",t); } 执行后输出结果是【 】。
有以下程序 main() { int t=1,i=5; for( ; i>=0; i--) t*=i; printf("%d\n",t); } 执行后输出结果是【 】。
admin
2010-01-10
23
问题
有以下程序
main()
{ int t=1,i=5;
for( ; i>=0; i--) t*=i;
printf("%d\n",t);
}
执行后输出结果是【 】。
选项
答案
0
解析
本题中的for循环共执行了6次,每执行一次将相应i的值相乘,最后当i=-1时停止循环。该for循环执行完后t的值为5*4*3*2*1*0=0,故最后输出t的值为0。
转载请注明原文地址:https://kaotiyun.com/show/XUWp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
设变量x的值是845,则下面语句的输出是Printx\100+(xMod100)\10+xMod10
窗体上有一个名称为Command1的命令按钮,一个名称为Text1的文本框。编写如下程序:PrivateSubCommand1_Click()DimxAsIntegerx=Val(InputBox("输入数据"))Text1=Str(x+
以下表达式与Int(3.5)的值相同的是
有如下程序:Functionfun(ByValauraAsInteger)AsIntegerDimkAsIntegerk=1num=Abs(num)DoWhilenumk=k*(numMod10):n
编写如下程序:PrivateSubCommand1_Click()Dima(3,3)AsInteger,sAsIntegerFori=1To3Forj=1To3a(i,j)=i*j+iNextjNextis=0
为了在运行时能显示窗体左上角的控制框(即系统菜单),应执行的操作是()。
设有如下语句:Dima,bAsIntegerc=“VisualBasic”d=#7/20/2005#以下关于这段代码的叙述中,错误的是
软件生命周期可分为定义阶段、开发阶段和维护阶段,下面属于定义阶段任务的是()。
下面是求最大公约数的函数的首部Functiongcd(ByValxAsInteger,ByValyAsInteger)AsInteger若要输出8、12、16这3个数的最大公约数,下面正确的语句是
为了计算下面的分段函数(其中x为整数)某人编写了如下函数Functionfun(xAsInteger)AsIntegerDimyAsIntegerSelectCasexCasex
随机试题
木材的持久强度一般为极限强度的()。
今天,书籍人人都可以得到,因为书籍不再昂贵了。
(2008年考试真题)开放式基金的分红方式有()。
基金销售机构内部控制应履行()的原则。
中国银行曾先后9次被《欧洲货币》评选为()
李同学觉得自己很失败,各方面都很差,对自己丧失了信心,在心理学上把这种现象称为()。
教师自身的业务能力和()是衡量师德高低的重要标准,幼儿园教师要严格要求自己,不仅要以知识技能去影响幼儿,还要以品行、仪表去感染幼儿。
世界统一于存在。()
根据下列资料,回答以下问题。下列说法正确的是:
在考生文件夹下,打开文档Word1.docx,按照要求完成下列操作并以该文件名Word1.docx保存文档。将正文各段文字(“为了……协助主处理器工作的。”)的中文设置为五号仿宋、英文设置为五号AriaIUnicodeMS字体;各段落左右各缩进1字符
最新回复
(
0
)