首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读下面程序: #include fun(int a,int b) {int c; c=a+b: retum C; } voidmain() {int x=6,y:7,z=8,r; r
阅读下面程序: #include fun(int a,int b) {int c; c=a+b: retum C; } voidmain() {int x=6,y:7,z=8,r; r
admin
2021-05-06
41
问题
阅读下面程序:
#include
fun(int a,int b)
{int c;
c=a+b:
retum C;
}
voidmain()
{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/Vah0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
假定a=3,下列程序的运行结果是()。#include<iostream.h>intfun(intn);voidmain(){cout<<’’Pleaseinputanumber:’’;
有如下语句序列:intx=100,&r=X,cout<<x<<’_’<<r<<end1:己知其中变量X的地址为0012FF7C,则执行该语句序列的输出结果为()。
有如下程序#inc1ude<iostream>#inc1ude<iomanip>usingnamespacestd;intmain(){cout<<setprecision(3)<<fixed<<se
有如下语句序列:ifstreaminfile("DATA.DAT");if(infile.good())cout
请使用VC6或使用【答题】菜单打开考生文件夹proj1下的工程proj1。程序中位于每个“//ERROR****found****”之后的一行语句有错误,请加以改正。改正后程序的输出结果应为:Name:SmithAge:21ID:99999Cour
下列特征中不是面向对象方法的主要特征的是()。
已知数组arr的定义如下:intarr[5]={1,2,3,4,5);下列语句中输出结果不是2的是()。
存在定义inta[10],x,*pa;,若pa=&a[0],下列的哪个选项和其他3个选项不是等价的()?
随机试题
美国作家海明威的代表作有()。
Lastyear,mybrotherandIwenttoMiamiforavacation.Someofmyfriendswhohadbeentherebeforesaid【K1】________wasawon
在很大程度上决定群体行为的效率和效果的是凝聚力的高低。
入芝兰之室久而不闻其香,入鲍鱼之肆久而不觉其臭,这种心理现象称为适应现象。()
急性肾小球肾炎可有如下几项表现,但除外
鸭病毒性肝炎主要发生在
一些银行自动每月将储户活期账户的闲置资金转为定期存款,当活期存款因刷卡消费或转账取现资金不足时,定期存款将转为活期存款。这种储蓄业务指的是( )。
听证应当由旅游主管部门负责法制工作的机构承办。听证由一名主持人和若干名听证员组织,也可以由主持人一人组织。听证主持人、听证员、书记员应当由()指定的非本案调查人员担任。
根据警情简报提供的基本情况回答下列问题。当地公安机关拟对突出犯罪问题开展防控,恰当的分析结论有()。(多选)
随着市场经济的发展,修理业摆脱计划价格束缚的呼声越来越高,放开价格已成为修理业市场繁荣发展的必然______,价格由市场主宰,经营者可以随行就市,______定价。依次填入划横线处的词语,最恰当的一组是()
最新回复
(
0
)