首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include #define N 5 #define M N+1 #define f(x)(x*M) main() { int i1,i2; i1=f(2); i2=f(1+1); printf
有以下程序 #include #define N 5 #define M N+1 #define f(x)(x*M) main() { int i1,i2; i1=f(2); i2=f(1+1); printf
admin
2013-02-23
17
问题
有以下程序
#include
#define N 5
#define M N+1
#define f(x)(x*M)
main()
{ int i1,i2;
i1=f(2);
i2=f(1+1);
printf("%d %d\n",i1,i2);
}
程序的运行结果是
选项
A、12 12
B、11 7
C、11 11
D、12 7
答案
B
解析
根据宏替换的替换规则,我们可知,f(2)=2*N+1=2*5+1=11,f(1+1)=1+1*N+1=1+1*5+1=7。
转载请注明原文地址:https://kaotiyun.com/show/HBJp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
关系模型的数据操纵即是建立在关系上的数据操纵,一般有【】、增加、删除和修改四种操作。
在C语言中,函数的隐含存储类别是()
若以下程序所生成的可执行文件名为file1.exe,main(intargc,char*argv[]){while(argc-->0){++argv;printf("%s",*argv);}}当键入以下命令执行该程序时
以下叙述中正确的是()
下面函数的功能是:找出一维数组元素中最大的值和它所在的下标,最大值的和它所在的下标通过形参传回。数组元素中的值已在主函数中赋予。主函数中x是数组名,n是x中的数据个数,max存放最大值,index存放最大值所在元素的下标。请填空。#include<
经下列语句定义后,sizeof(x)、sizeof(y)、sizeof(a)、sizeof(b)在IBM-PC机上的值分别为______。charx=65;floaty=7.3;inta=100;doubleb=4.5;
数据流图用于抽象描述一个软件的逻辑模型,数据流图由一些特定的图符构成。下列图符名标识的图符不属于数据流图合法图符的是
已知intk=10,m=3,n;则下列语句输出结果是printf("%d\n",n=(k%m,k/m));
数据库管理系统常见的数据模型有层次模型、网状模型和【】3种。
设顺序输入数列为:24,30,8,5,1,27,24,26,10,21,9,28,7,13,15。假定每个结点的查找概率相同,若用顺序存储方式组织该数列,则查找一个数成功的平均比较次数为【】;若按二叉排序树结构组织该数列,则查找一个数成功的平均比较次数
随机试题
A.肾上腺素B.阿托品C.异丙肾上腺素D.多巴胺E.去甲肾上腺素可引起胃肠道平滑肌松弛的是()
Theflowers______astrongfragrance.
正常成年人每天需排出900mmol/L溶质。如果某人尿浓缩稀释功能障碍,尿液最大渗透浓度为300mmol/L,那么,他每天至少需饮多少水才能防止体液的渗透浓度升高(假定不显汗丧失水为1.5L/d)
选用抗生素的基本原则是
耻骨联合上缘至股骨内上髁上缘的骨度分寸是( )
下列关于废气治理方法应用范围的表述中,错误的是()。
认股权证具有实现融资和股票期权激励的双重功能。()
(2018年改)某企业仅生产M产品,采用约当产量比例法在完工产品和月末在产品之间分配生产费用。M产品生产需要经过三道工序,各工序的工时定额分别为:第一道工序30小时,第二道工序18小时,第三道工序12小时。假定各工序内在产品的完工程度均为50%,生产M产品
洞庭湖位于湖南省北部,为我国第______大淡水湖,登岳阳楼可俯瞰洞庭湖,有“洞庭天下水,岳阳天下楼”之誉。
ElvisAaronPresleywasbornina【B1】______houseinTupelo,MississippionJanuary8,1935.Histwinbrother,JessieGaron,die
最新回复
(
0
)