首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include #define f(x) x*x*x main() { int a=3,s,t; s=f(a+1); t=f((a+1)); printf("%d,"d\n",s,t
有以下程序 #include #define f(x) x*x*x main() { int a=3,s,t; s=f(a+1); t=f((a+1)); printf("%d,"d\n",s,t
admin
2020-07-28
23
问题
有以下程序
#include
#define f(x) x*x*x
main() {
int a=3,s,t;
s=f(a+1);
t=f((a+1));
printf("%d,"d\n",s,t);}
程序运行后的输出结果是
选项
A、10,10
B、10,64
C、64,10
D、64,64
答案
B
解析
根据题目中宏f(x)的定义,f(a+1)=a+1*a+1*a+1=a+a+a+1=10,而f((a+1))=(a+1)*(a+1)*(a+1)=4*4*4=64。
转载请注明原文地址:https://kaotiyun.com/show/563p777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
使用VC++2010打开考生文件夹下modi1中的解决方案。此解决方案的项目中包含一个源程序文件modi1.c。在此程序中,函数fun的功能是:读入一个字符串(长度<20),将该字符串中的所有字符按ASCII码值升序排序后输出。例如,若输入"edcba",
使用VC++2010打开考生文件夹下modi1中的解决方案。此解决方案的项目中包含一个源程序文件modi1.c。在此程序中,函数fun的功能是:将p所指字符串中的所有字符复制到b中,要求每复制三个字符之后插入一个空格。例如,若给a输入字符串:“ABCDE
已知学生的记录由学号和学习成绩构成,N名学生的数据已存入a结构体数组中。请编写函数fun,该函数的功能是:找出成绩最高的学生记录,通过形参返回主函数(规定只有一个最高分)。已给出函数的首部,请完成该函数。注意:请勿改动主函数main和其他函数中的任何内容
设有如下的程序段:charstr[]=’’HelloWorld’’;char*ptr;ptr=str;执行上面的程序段后,“*(ptr+10)”的值为()。
若有代数式(其中e仅代表自然对数的底数,不是变量),则下列能够正确表示该代数式的C语言表达式是()。
程序通过定义学生结构体变量,存储了学生的学号、姓名和3门课的成绩。函数fun的功能是对形参b所指结构体变量中的数据进行修改,最后在主函数中输出修改后的数据。例如:b所指变量t中的学号、姓名、和三门课的成绩依次是:10002、’’ZhangQi’’、9
给定程序MODI1.C中函数fun的功能是:从n(形参)个学生的成绩中统计出低于平均分的学生人数,此人数由函数值返回,平均分存放在形参aver所指的存储单元中。例如,若输入.8名学生的成绩:80.5607290.59851.5
在关系数据库设计中,关系模式设计属于
建立表示学生选修课程活动的实体联系模型,其中的两个实体分别是
结构化程序设计的基本原则不包括
随机试题
预测某企业未来收益,其中前5年分别为120万元、125万元、128万元、120万元和130万元,从第6年开始,企业收益将基本保持在120万元的水平上,已知折现率、资本化率同为10%。求该企业的整体资产评估值。
下述哪一项与系统性红斑狼疮诊断有关
我方以CFR贸易术语与B国的H公司订立成交一批消毒碗柜的出口合同,合同规定装运时间为4月15日前。我方备妥货物,并于4月8日中午装船完毕,由于遇星期日休息,我方的业务员未及时向买方发出装运通知,导致买方未能及时办理投保手续,而货物在4月8日晚因发生了火灾被
Therequirementsforhighschoolgraduationhavejustchangedinmycommunity.Asaresult,allstudentsmust【C1】______sixtyhou
WhohastherealpowerintheBritishgovernment?
通报适用于()。
串的长度是
果
Howmanypeopleliveincitiesnow?
They______afootballmatchatfouro’clockyesterdayafternoon.
最新回复
(
0
)