首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读下面程序: #include<iostream.h> fun(int a,intb) { int c; c=a+b: return C; ) void main() { int x=6,y=7,z=8,r; r=fun((x--,y++,x+y),z-
阅读下面程序: #include<iostream.h> fun(int a,intb) { int c; c=a+b: return C; ) void main() { int x=6,y=7,z=8,r; r=fun((x--,y++,x+y),z-
admin
2016-10-28
21
问题
阅读下面程序:
#include<iostream.h>
fun(int a,intb)
{
int c;
c=a+b:
return C;
)
void main()
{
int x=6,y=7,z=8,r;
r=fun((x--,y++,x+y),z--);
cout<<r<<endl;
)
则该程序的输出结果是( )。
选项
A、11
B、20
C、21
D、31
答案
C
解析
由主函数入手,定义变量x、y、z,然后调用函数fun,其中的参数为(x--,y++,x+y)的计算结果和z一的计算结果,所以调用fun(13,8)计算结果为21。
转载请注明原文地址:https://kaotiyun.com/show/ZKNp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列程序的运行结果是()。#include<iostream.h>classA{inta;public:A(){a=0:}A(intaa)
如果一个类中定义了成员对象,则该类的对象和成员对象先被初始化的是______。
对于下面的程序ifstreamfin(C:\test.tXt);if(fin)cout<<"ok";elsecout<<"wrong";对于if语句中的内容可以换为
【】是当前软件开发环境中富有特色的研究工作和发展方向。
下列叙述中正确的是
头文件______中包含了处理用户控制的文件操作所需的信息。
当使用fstream流类定义一个流对象并打开一个磁盘文件时,文件的隐含打开方式为
在C++语言中每个类都有一个【】指针,该指针指向正在调用成员函数的对象。
软件工程研究的内容主要包括【】技术和软件工程管理。
下列关于模板的说法正确的是
随机试题
WhatdidHelen’semployersgiveherformalfeedbackon?
中心型肺癌与肺门淋巴结结核鉴别,最好的手段是
急性牙髓炎主要表现是剧烈的疼痛,其疼痛特点下列哪项是错误的
患者女性40岁,情绪低落、快感丧失、兴趣丧失和精力丧失,似乎充满了无助和绝望,体会不到生活的乐趣。长期口服阿米替林,175mg,1次/日。因家中变故,惊恐发作加重,每周发作4~5次,前来就诊。诊断:抑郁症。医嘱如下。该患者使用地西泮的作用是(
47号元素Ag的基态价层电子结构为4d105s1,它在周期表中的位置是:
东南沿海某市拟建西北绕城高公路工程有主线和一条连接线组成。主线全长57.55km,按照双向六车道高速公路标准建设,设计行车速度100km/h,路基宽度33.5m。主线起点(K0+000)接城西已建高速互通,在城区外围向东北方向展线,以桥梁形式(K26+12
按利率的制定可将利率划分为:()。
设a1,a2,…,as均为n维列向量,A是m×n矩阵,则下列选项正确的是().
OurculturehascausedmostAmericanstoassumenotonlythatourlanguageisuniversalbutthatthegesturesweuseareunderst
Forthispart,youareallowedthirtyminuteswwriteacompositiononthetopic"ReadingSelectivelyorExtensively".Youshoul
最新回复
(
0
)