首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include<stdio.h> intfun(intx,inty) {iflx=y)retum(x); elseretum((x+y)/2); } main( ) {inta=4,b=5,c=6; printf(’’%d\m’’,fu
有以下程序 #include<stdio.h> intfun(intx,inty) {iflx=y)retum(x); elseretum((x+y)/2); } main( ) {inta=4,b=5,c=6; printf(’’%d\m’’,fu
admin
2014-06-18
79
问题
有以下程序
#include<stdio.h>
intfun(intx,inty)
{iflx=y)retum(x);
elseretum((x+y)/2);
}
main( )
{inta=4,b=5,c=6;
printf(’’%d\m’’,fun(2*a,fun(b,c)));
}
程序运行后的输出结果是
选项
A、3
B、6
C、8
D、12
答案
B
解析
fun(b,C即fun(5,6),51=6,所以返回(5+6)/2=5;funn(2*a,5)即fun(8,5),81=5,所以返回(8+5)/2=6。
转载请注明原文地址:https://kaotiyun.com/show/qYJp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
以下程序的输出结果是#include<stdi0.h>main(){inti=0,a=0;while(i<20){for(;;){if((i%10)==0)break;
以下程序的输出结果是main(){inta=5,b=4,c=6,d;printf((“%d\n”,d=a>b?)(a>c?a:c):(b));}
若定义:inta=511,*b=&a;则printf(“%d\n”,*b);的输出结果为
C语言中用于结构化程序设计的三种基本结构是
指针变量p和数组a的说明如下:int*a[3]={"aa","bb","cc"},**p;执行语句p=&a[2];后,*p指向的字符串是______。
下述程序的输出结果是()。longfun(intn){longs;if(n==1||n==2)s=2;elses=n-fun(n-1);returns;}main()
若有如下程序段:structstudent{intnum;floatscore;}stu[3]={{10,85},{60,58},{32,23}};main(){structstudent*t;
下列叙述中正确的是()。
下列选项中不能正确定义结构体的是_______。
随机试题
WillthereeverbeanotherEinstein?ThisistheundercurrentofconversationatEinsteinmemorialmeetingsthroughouttheyear.
五脏与五液的关系中,与肺相应的液是
工程项目不包括()。
下列各项中,属于重大事项的有()。
期刊论文、学位论文属于()
《蒙娜丽莎》这幅画,在儿童眼里看到的是母爱,在情侣眼里看到的是甜蜜,在朋友眼里看到的是真诚,这说明()。
针对《刑法》的适用范围,下列观点正确的是()。
A、 B、 C、 D、 A每组前两个图形叠加去同存异后顺时针旋转90度得到第三个图形,A项满足。
DaphnaEdwardsZimanisoneofthefamousmothersinAmericanhistory.Sheisthemotherofan(36)______child,forWhomsheha
Smokersinthe"landofthefree"arefindingthemselvesincreasinglylessfreetopursuetheirhabit.NewYorkCityofficialsa
最新回复
(
0
)