首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include int fun(int x,int Y) { if(x==y)retum(x); else return((x+y)/2); } main() { int
有以下程序 #include int fun(int x,int Y) { if(x==y)retum(x); else return((x+y)/2); } main() { int
admin
2013-10-19
28
问题
有以下程序
#include
int fun(int x,int Y)
{ if(x==y)retum(x);
else return((x+y)/2);
}
main()
{ int a=4,b=5,c=6;
printf("%dhn",fun(2*a,fun(b,c)));
}
程序运行后的输出结果是
选项
A、3
B、6
C、8
D、12
答案
8
解析
fun(b,c)即fun(5,6),5!=6,所以返回(5+6)/2=5;fun(2*a,5)即fun(8,5),8!=5,所以返回(8+5)/2=6。
转载请注明原文地址:https://kaotiyun.com/show/6qJp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下列叙述中错误的是()。
以下程序试图把从终端输入的字符输出到名为abc.txt的文件中,直到从终端读入字符串#号时结束输入和输出操作,但程序有错#include<stdio.h>main(){FILE*fout;charch;
设有以下声明语句streetex{intx;floaty;charz;}example;则下面的叙述中不正确的是______。
以下程序执行后sum的值是______。main(){inti,sum;for(i=1;i<6;i++)sum+=i;printf("%d\n",sum);}
在下列几种排序方法中,要求内存量最大的是______。
下面程序的输出结果是()。main(){structm1{inta;intb;}en[2]={1,3,2,7);printf("%d\n",en[0].b/en[0].a*en[1].a);
在C语言中,要求运算数必须是整型的运算符是()
数据库设计包括两个方面的设计内容,它们是_______。
下述关于数据库系统的叙述中正确的是_______。
软件测试是保证软件质量的重要手段,而软件测试的主要和重要的测试方法是通过测试数据和【】的设计来实现。
随机试题
近百年来,在达里湖地区,长期的干旱使多草的湿地大量萎缩,变成盐碱地。多草的湿地是鸭类、鹅类以及其他种类水鸟筑巢和孵化的场所。然而,随着湿地的不断萎缩,该地区赤麻鸭数量平均下降的速度却远低于天鹅数量平均下降的速度。如果以下哪项陈述为真,对上文中的不一致给出了
礼貌友善的问候用语,积极热情的问候态度是问候礼节的基本要求。
对全结构式教育观察特点描述错误的是()
申请医师执业注册时,以下可以注册的情形是
下列关于双胍类药物的描述不正确的是
下列说法中,符合下岗失业人员小额担保贷款遵循的原则是()。
经核查,征信服务中心如无法确认异议信息的正误,应()。
下列业务中,能够降低企业短期偿债能力的是()。
以下关于我国科技史,不正确的是()。
有以下程序,执行后的结果是#includemain(){chars[]="abcde";s+=2;printf("%d\n",s[0]);}
最新回复
(
0
)