首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include<stdio.h> intfun(intx){ intp; if(x=0‖x=1)return(3); p=x-fun(x-2);retum(p);) main( ){ printf(’’%d\n’’,fun(9)); }
有以下程序 #include<stdio.h> intfun(intx){ intp; if(x=0‖x=1)return(3); p=x-fun(x-2);retum(p);) main( ){ printf(’’%d\n’’,fun(9)); }
admin
2014-06-18
14
问题
有以下程序
#include<stdio.h>
intfun(intx){
intp;
if(x=0‖x=1)return(3);
p=x-fun(x-2);retum(p);)
main( ){
printf(’’%d\n’’,fun(9));
}
程序运行后的输出结果是
选项
A、5
B、9
C、4
D、7
答案
D
解析
函数fun的主要功能是:
初值x的值为9,因此fun(9)=9.fun(7)=9.(7.(5-(3-3))),因此答案为7。
转载请注明原文地址:https://kaotiyun.com/show/tYJp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
以下程序的输出结果是main(){intb[3][3]={0,1,2,0,1,2,0,1,2},i,j,t=1;for(i=0;i<3;i++)for(j=i;j<=i;j++)t=t+b[i][b[j][
以下不能正确进行字符串赋初值的语句是
若指针p已正确定义,要使p指向两个连续的整型动态存储单位,不正确的语句是
以下程序的输出结果是chsrcchar(charch){if(ch>=’A’&&ch<=’Z’)ch=ch-’A’+’a’;returnch;}main(){chars[]=“
在一个C程序中
在C语言中,关于函数fseek的说法正确的是()。
下面程序的输出结果是()。#definePI3.1415#defineARE(X)PI*x*xmain(){intr=2;printf("%.2f",ARE(r+1));}
下列关于关系运算的叙述中正确的是()。
在C语言中,函数中变量的隐含存储类别是______。
随机试题
中心型肺癌与肺门淋巴结核的鉴别,最好的手段是
上颌第一磨牙的邻面接触区是
患者,女性,36岁,诊断为支气管扩张,咳嗽,咳痰,痰量60ml/天,最应该采取的护理措施是
我国《建设工程安全生产管理条例》规定,对没有安全施工措施的建设项目,建设行政主管部门不予颁发()。
直接风能海水淡化是将风能转化的机械能直接用于驱动脱盐单元进行海水淡化的方法。间接风能海水淡化是先将风能转化为电能,然后再驱动脱盐单元进行海水淡化的方法。间接风能海水淡化根据供电方式的不同又可分为离网型和并网型。直接风能海水淡化的优点是省去了“机械能一电能一
一、注意事项1.申论考试与传统的作文考试不同,是分析驾驭材料的能力与表达能力并重的考试。2.仔细阅读给定的资料,按照后面提出的“作答要求”依次作答。二、给定资料1.四川宜宾县孔滩镇万家村,早上7时,11岁的留守女孩王素悄悄起床
Whatwouldyoudowith$590m?Thisisnowa(n)【B1】______forGloriaMacKenzie,an84-year-oldwidowwhorecently【B2】______fromh
Imaginativeworkssuchasnovels,plays,films,fairytales,andlegendspresentamoreaccurateandmeaningfulpictureofhuman
Thecomputerbringsboththebenefitsanddangers.Thespeakermeansdangerto______well-beingofthepeoplewhoareatcomput
ThefloodofwomenintothejobmarketboostedeconomicgrowthandchangedU.S.societyinmanyways.Manyin-homejobsthatuse
最新回复
(
0
)