首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的运行结果为( )。 #include void print(double a) { cout
下列程序的运行结果为( )。 #include void print(double a) { cout
admin
2017-02-18
22
问题
下列程序的运行结果为( )。
#include
void print(double a)
{
cout<<++a:
}
void print(int a,int b)
{
cout<
}
void main()
{
print(1.2);
cout<<"":
print(3,4);
}
选项
A、1.2 34
B、2.2 34
C、1.2 43
D、2.2 43
答案
D
解析
本题考查的是对重载函数的掌握,因为++a是右结合的,所以a先自加1再输出,即为2.2,之后调用函数print(int a,int b)输出b和a,即43。
转载请注明原文地址:https://kaotiyun.com/show/bBAp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
一个()允许用户为类定义一种模式,使得类中的某些数据成员、某些成员函数的参数和返回值能取任意数据类型。
下列关于C++函数的描述中正确的是()。
下面程序的输出结果是【】。#include<iostream.h>voidmain(){inta[6]={1,2,3,4,5,6};for(inti=0;i<5;i++)
下列函数的运行结果是#include<iostream.h>intf(inta,intB){intc;if(a>b)c=1elseif(a=b)c=0;
软件工程的出现是由于
在软件工程中,白箱测试法可用于测试程序的内部结构。此方法将程序看做是
C++语言的基本控制结构为顺序结构、选择结构和【】。
当循环队列非空且队尾指针等于队头指针时,说明循环队列已满,不能进行入队运算。这种情况称为【】。
下面关于构造函数和析构函数的描述,错误的是()。
软件工程研究的内容主要包括【】技术和软件工程管理。
随机试题
油气的流动是各种能量同时作用的结果,在油田的不同开发阶段各自发挥的作用大小相同。()
下列哪项不是浅龋的临床表现
球后穴位于眶下缘的
定金合同是当事人双方为了保证债务的履行,按照合同规定向对方预先给付一定数额的货币,定金的数额由当事人约定,但不得超过主合同标的额的()。
某办公大楼在保修期间出现外墙裂缝,经查是由于设计缺陷造成,原施工单位进行了维修,之后应向( )主张维修费用。
计算机内处理的是汉字的交换码。()
法律制裁是实现法律责任的方式,其内容包括制裁、补偿和强制。其电,制裁是最主要的实现法律责任的方式。 ( )
用人单位与劳动者发生劳动争议,当事人可以依法申请调解、仲裁、提起诉讼,也可以协商解决。()
中国抗日战争全面爆发的标志是九一八事变。()
Ifyouwanttoimproveyourchild’sresultsatschool,【T1】______thattheydoplentyofexercise.Scientistshavealreadyshownt
最新回复
(
0
)