首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的输出结果是 #include"iostream" using namespace std; int Max(int a,int b) { if(a>b)
下列程序的输出结果是 #include"iostream" using namespace std; int Max(int a,int b) { if(a>b)
admin
2010-03-29
44
问题
下列程序的输出结果是 #include"iostream" using namespace std; int Max(int a,int b) { if(a>b) return a; else return b; } void main( ) { int m,n; m=10,n=5; int max = Max(m,n); cout<<max<<endl; }
选项
A、10
B、程序有误
C、1
D、0
答案
1
解析
本题函数Max的功能是求出两个整数中的较大者,并且通return语句返回。注意:return语句的用法,注意return的条件。
转载请注明原文地址:https://jikaoti.com/ti/WLW0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
设有以下定义chars1[]="0123";chars2[]={’0’,’1’,’2’,’3’};则以下叙述正确的是
以下函数的功能是:计算a的n次方作为函数值返回。doublefun(doublea,intn){inti;doubles=1.0;for(i=1;i<=n;i++)S=________;returns;}
能从任意一个结点开始没有重复地扫描到所有结点的数据结构是()。
设q1和q2是指向一个int型一维数组的指针变量,k为float型变量,下列不能正确执行的语句是()。
下面结构体的定义语句中,错误的是()。
有三个关系R,S和T如下:其中关系T由关系R和S通过某种操作得到,该操作为()。
数据库设计中反映用户对数据要求的模式是()。
在排序过程中,每一次数据元素的移动会产生新的逆序的排序方法是
若有函数首部intfun(doublex[10],int*n),则下列针对此函数的函数声明语句中正确的是()。
对于以下函数声明 voidfun(intarray[4],int*ptr);以下叙述中正确的是()。
随机试题
简述社会主义从一国到多国发展的历史贡献与经验教训。
急性胰腺炎的诊断中具有重要意义的检查是
带下量多热毒蕴结证的带下特点是()
护士对于上消化道大出血伴休克的患者施行的首要护理措施是
某北方平原地区二级公路设计车速60km/h,路基宽度10m。施工单位通过招投标获得第Ⅳ标段施工任务。路基填料为土方,该标段挖方量为177.56万m3,填方量为156.75万m3。为确保项目的工期、质量、安全和成本,项目部制定了施工方案和一系列的规章制度。项
循序渐进原则要遵循学科——和学生的身心发展的顺序性。
1928年至1930年间,毛泽东著述的有关中国革命新道路理论的重要文件有()。
网络系统生命周期可以划分为5个阶段,实施这5个阶段的合理顺序是__________。(2010年下半年试题)
在微机系统中,麦克风属于
A、Broadcastingfrightenedsoundsofthebirdstoscarethemaway.B、Makingshootingsoundstoscarethebirdsaway.C、Hiringspe
最新回复
(
0
)