首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读下面程序: #include fun(int a’int b) {int c; c=a+b: return c; } void main0 {int x=6,y=7,z=8,r;
阅读下面程序: #include fun(int a’int b) {int c; c=a+b: return c; } void main0 {int x=6,y=7,z=8,r;
admin
2019-04-18
27
问题
阅读下面程序:
#include
fun(int a’int b)
{int c;
c=a+b:
return c;
}
void main0
{int x=6,y=7,z=8,r;
r=fun((x一,y++,x+y),Z一);
cout<
}
则该程序的输出结果是( )。
选项
A、11
B、20
C、21
D、31
答案
C
解析
由主函数入手,定义变量x、y、z,然后调用函数fun,其中的参数为(x一,y++,x+y)的计算结果和z一的计算结果,所以调用fun(13,8)计算结果为21。
转载请注明原文地址:https://jikaoti.com/ti/h7t0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
如下程序的输出结果是#include<iostream>usingnamespacestd;classA{public:A(){cout<<"A";}};classB{public:B()
下列关于栈的描述中错误的是
执行下列语句段后,输出字符“*”的个数是for(inti=50;i>l;--i)cout<<”*”
执行下列程序段以后程序的输出是______。voidadd(int&x){x++;}intmain(){inty=3;add(y);cout<<y<<end1;}
在面向对象方法中,______描述的是具有相似属性与操作的一组对象。
若已知一个栈的入栈序列是1、2、3、…、n,其输出序列是p1、p2、p3、…、pn,则pi为()。
有如下程序:#include<iostream>usingnamespacestd;classA{public:A(){cout<<"A";}};classB{public:B(){c
数据管理技术的发展经历了人工管理、文件系统和数据库系统3个阶段,其中数据独立性最高的是______。
下列字符串中可以用作C++标识符的是
对于长度为n的有序线性表,在最坏情况下,二分法查找只需比较______次。
随机试题
医院内感染发生在
女,18岁。低热、腹痛、腹泻伴腹胀2个月。体查:腹壁揉面感,腹部移动性浊音阳性。腹水为渗出液。为明确诊断,下列哪项检查最有价值
环境标准体系中的()是确认环境是否已被污染的根据。
商业银行如果将保留的准备金维持在法定的()存款准备金水平上,则会使存款派生能力达到最大限度。
某高层建筑的地下配电室采用预制灭火系统,安装数量不宜大于()台,必须同时启动,动作响应时间不得大于()s。
关于刑事现场保护的下列说法中,错误的是()。
中国电影发展了百年之久,能够横行天下的,还是只有武侠片这一个类型。武侠片之所以能够__________,不断求变正是其生命力所在。可以说,武侠电影自诞生时起就一直在变化。通过一次次变化,武侠电影获得了一次次的__________。依次填入画横线部分最恰当的
下列四个词语中符合“平平仄仄”特征的是()。
VOD服务器应部署在位置(16),Web服务器应部署在位置(17),流量监控服务器应部署在位置(18)。上述服务器中,流出流量最大的是(19),流入流量最大的是(20)。
Mathematicalabilityandmusicalabilitymaynotseemonthesurfacetobeconnected,butpeoplewhohaveresearchedthesubject
最新回复
(
0
)