首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include<stdio.h> main() int f(int x,int y) {int a=3,b=4,c=5,d; {return((y-x)*x);} d=f(f(a,b),f(a,c)); printf("%d\n",
有以下程序 #include<stdio.h> main() int f(int x,int y) {int a=3,b=4,c=5,d; {return((y-x)*x);} d=f(f(a,b),f(a,c)); printf("%d\n",
admin
2019-08-18
22
问题
有以下程序
#include<stdio.h> main()
int f(int x,int y) {int a=3,b=4,c=5,d;
{return((y-x)*x);} d=f(f(a,b),f(a,c));
printf("%d\n",d);}
程序运行后的输出结果是
选项
A、10
B、8
C、9
D、7
答案
C
解析
本题考查函数的嵌套调用。首先计算f(a,b)与f(a,c),f(a,b)=(b-a)*a=3,f(a,c)=(c-a)*a=6,然后计算f(3,6)=(6-3)*3=9。
转载请注明原文地址:https://kaotiyun.com/show/cZRp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
给定程序MODI1.C中函数fun的功能是:求整数x的y次方的低3位值。例如,整数5的6次方为15625,此值的低3位值为625。请改正函数fun中指定部位的错误,使它能得出正确的结果。注意:不要改动main函数,不得增行或删行,也不得
请编写一个函数fun,它的功能是:将ss所指字符串中所有下标为奇数位置上的字母转换为大写(若该位置上不是字母,则不转换)。例如,若输入"abc4EFg",则应输出"aBc4EFg"。注意:部分源程序存在文件PROG1.C中。请
给定程序中,函数fun的功能是:有NxN矩阵,根据给定的m(m
给定程序MODI1.C中函数fun的功能是:按以下递归公式求函数值。例如,当给n输入5时,函数值为18;当给n输入3时,函数值为14。请改正程序中的错误,使它能得出正确结果。注意:不要改动main函数,不得增行或删行,也不得
学生的记录由学号和成绩组成,N名学生的数据已在主函数中放入结构体数组S中,请编写函数fun,它的功能是:按分数的高低排列学生的记录,高分在前。注意:部分源程序在文件PROG1.C文件中。请勿改动主函数main和其他函数中的任何内容,仅
给定程序MODI1.C中函数fun的功能是:为一个偶数寻找两个素数,这两个素数之和等于该偶数,并将这两个素数通过形参指针传回主函数。请改正函数fun中指定部位的错误,使它能得出正确的结果。注意:不要改动main函数,不得增行或删行,也不
下列给定程序中,函数fun的功能是:将形参n所指变量中,各位上为偶数的数去掉,剩余的数按原来从高位到低位的顺序组成一个新数,并通过形参指针n传回所指变量。例如,若输入一个数27638496,则新数为739。请在程序的下画线处填入正确的内容并将下
下列选项中属于面向对象设计方法主要特征的是
软件详细设计产生的图如下:该图是
以下叙述中正确的是
随机试题
投资谈判
碱性最强的生物碱类型是
关于项目总投资,说法正确的有()。
根据《全国土地利用总体规划纲要》,土地利用与管理要遵循的基本原则有()
从事货物生产或提供应税劳务以外的纳税人,年应税销售额在()万元以下的为增值税小规模纳税人。
会员制期货交易所理事因故不能出席理事会会议的,应当以书面形式委托其他理事代为出席,每位理事只能接受一位理事的委托。()
宋代把未缴纳契税未加盖官印的契约称为()(2012年一综一第39题)
设某静态RAM芯片容量为8K×8位,若用它组成32K×8位的存储器,所用芯片数以及这种芯片的片内地址线数目是( )。
Mostpeoplehavenoideaofthehardworkandworrythatgointothecollectingofthosefascinatingbirdsandanimalsthatthey
Lookatthechartcarefullyandwriteyourresponseinabout200words,inwhichyoushouldstartwithabriefdescriptionofth
最新回复
(
0
)