首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的输出结果是 #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
32
问题
下列程序的输出结果是 #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://kaotiyun.com/show/jVjp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列程序的运行结果为()。#include<stdio.h>voidabc(char*str){inta,b,i,j;for(i=j=0;str[i]!=’\0’;i++)if(str[i]
下列语句组中,不正确的是()。
给定程序MODI1.C中函数fun的功能是:删除P所指字符串中的所有空白字符(包括制表符、回车符及换行符)。输入字符串时用’#’结束输入。请改正程序中的错误,使它能输出正确的结果。注意:不要改动main函数,不得增行或删行,也
给定程序中,函数fun的功能是:找出N×N矩阵中每列元素中的最大值,并按顺序依次存放于形参b所指的一维数组中。请在程序的下画线处填入正确的内容并把下画线删除,使程序得出正确的结果。注意:部分源程序在文件BLANK1.C中。不得
若有如下说明,且int类型占两个字节,则正确的叙述为()。structst{inta;intb[2];}a;
一个栈的初始状态为空。现将元素1,2,3,A,B,C依次入栈,然后再依次出栈,则元素出栈的顺序是
在软件开发中,需求分析阶段产生的主要文档是()。
在数据库系统的内部结构体系中,索引属于()。
将C语言的整数设为整数类I,则下面属于类I实例的是()。
在面向对象方法中,不属于“对象”基本特点的是()。
随机试题
戴望舒曾因发表了著名的诗作《雨巷》而被称为_____诗人。
甲、乙订立合同,合同中约定“本合同自甲方去世时生效”.该条款属于()。
2002年,创业时的H公司,只生产风扇,需要的是当机立断的决策机制。当时采用直线式管理简单直接、环节清晰。几年后H公司已经变成了集团,直线式管理的弊端渐显。各个产品经营单位埋头生产,整个集团的五大种类、近千种产品统一由销售公司负责推广。产销脱节的矛盾使原有
合理的工资总额可以用()的方法来推算。
班规是一种典型的潜在课程,是班级成员共同承诺遵守的行为规范及评价规定。()
你到一个新单位,你的上司很平庸。你会如何做?
A、 B、 C、 D、 B每一列的三个图形的部分数,依次为1,2,4。
喜喜和乐乐一起乘坐商场的电梯,在电梯正常运行的情况下,乐乐每秒钟向上迈一级台阶,喜喜为了超过乐乐,每秒向上迈两级台阶。结果乐乐比喜喜晚5秒钟到达地面。已知扶梯共有60级台阶。则乐乐和喜喜所迈台阶数之差为()。
阅读下列文字。完成下列题。“蚁族”这一新生名词迅速成为社会上流行的语词,因为他隐喻了社会的变革发展中正在形成的重要问题.即教育在个人的社会地位获得过程中所具有的效用与价值的问题。在现代社会中,平等开放与普适化的教育是社会个体成员获取社会
上颌前磨牙与下颌前磨牙区别中,哪一项是错误的()。
最新回复
(
0
)