首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include int f(int x,int y) {retum((y—x)*x);} main() {int a=3,b=4,c=5,d; d=f(f(a,b),f(a,c));
有以下程序: #include int f(int x,int y) {retum((y—x)*x);} main() {int a=3,b=4,c=5,d; d=f(f(a,b),f(a,c));
admin
2021-07-09
36
问题
有以下程序:
#include
int f(int x,int y)
{retum((y—x)*x);}
main()
{int a=3,b=4,c=5,d;
d=f(f(a,b),f(a,c));
printf(“%d\n”,d);
}
程序运行后的输出结果是( )。
选项
A、7
B、10
C、8
D、9
答案
D
解析
调用f(a,b)函数返回3,调用f(a,c)函数返回6,所以外层调用f(f(a,b),f(a,c));即调用f(3,6)函数返回9。
转载请注明原文地址:https://www.kaotiyun.com/show/WZtp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序:#includemain(){chara,b,c,d;scanf("%c%c",&a,&b);c=getchar();d=getchar();printf("%c%c%c
若已包括头文件<stdio.h>和<string.h>,运行下面程序的输出结果是()。chars1[10]="12345",s2[10]="089",s3[]="67";strcat(strcpy(s1,s2),s3);puts(s1);
若有定义:floata=22;inti=0,k=18;下列选项中不合法的C语言表达式是()。
以下叙述中正确的是()。
以下选项中,当x为大于1的奇数时,值为0的表达式为()。
以下选项中不属于C语言程序运算符的是
设序列长度为n,在最坏情况下,时间复杂度为O(log2n)的算法是
算法的时间复杂度是指()。
随机试题
木材中的水有_______、_______和_______三种。
微机正在工作时电源突然中断供电,此时计算机___________中的信息全部丢失,并且恢复供电后也无法恢复这些信息。
A.桂枝B.半夏C.陈皮D.人参E.白术实脾散的组成药物中含有
产品质量法所称产品是()。
在进行保险规划时,会面临很多风险。下列选项中,会引发风险的行为有()。
以下哪一种不属于非程序性计划?()
Oneimportantpartofpara-linguisticsisaccent,whichdescribesthosefeaturesofpronunciationthatidentifyapersoneither
Readthefollowingarticlesinwhichfourpeopletalkedabouttheirworkandlife.Forquestions61to65,matchnameofeachsp
YouwillhearfivedifferentpeopletalkingabouttheMasterofBusinessAdministrationcourses(MBAs)whichtheyhavetaken.For
A、正确B、错误A根据原文“Bythetimemymotherturnedfourteen,shecouldnolongerbearlifeinhergrandmother’shouse.Shefoundworkas
最新回复
(
0
)