首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #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
2010-12-10
21
问题
有以下程序
#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/psPp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
从键盘上输入一个浮点数asingle,利用字符串函数对该数进行处理后,如果输出的内容不是“非浮点数”,则对程序输出的内容分析正确的是()。asingle=InputBox("请输入一个浮点数:")strl$=Str$(asing
实现字符的UniCode编码方式一-~ANSI编码方式相转换的函数是()。
以下叙述中错误的是( )。
设在窗体上有一个名称为Check1的复选框数组,并有以下事件过程:PrivateSubCheck1_Click(IndexAsInteger) …EndSub则下面叙述中错误的是( )。
在考生文件夹下有一个工程文件vbsj5.vbp,请先装入该工程文件,然后完成以下操作:在名称为Forml的窗体上画两个命令按钮,其名称分别为cmdRead和cmdCal,标题分别为“读入数据”和“汁算保存”(如图2.42所示)。程序运行后,如果单击“跌入数
窗体上有1个名称为Text1、内容为空的文本框。编写如下事件过程:PrivateSubText1_KeyUp(KeyCodeAsInteger,ShiftAsInteger) PrintText1.Text;EndSub运行程序,
下列关于菜单项的描述中,错误的是
设有如下程序:PrivateSubForm_Click() num=InputBox("请输入一个实数") p=InStr(num,".") Ifp>0Then PrintMid(num,p+1) Else
有下面程序代码:PrivateSubCommand1_Click()DimsignAsIntegersign=1a=1b=2Fork=1To
已知过程定义的首行为Subsum(aAsInteger,bAsInteger),则下面过程调用语句中正确的是()。
随机试题
A、张口受限B、复视C、耳鼻出血D、颅面分离E、咬牙合错乱颅底骨折常伴有
期间费用包括()。
下列选项中,企业可以考虑实行前向一体化战略的是()。
2000年《中国居民膳食营养素参考摄入量》推荐学龄前儿童维生素A的可耐受最高剂量为()μg/日。
沙滩排球_______年起源于_______,_______年开始传入欧洲,_______年正式成为奥运会正式比赛项目。
警衔是区分人民警察()、表明人民警察身份的称号、标志和国家给予人民警察的荣誉。
市场经济是以计划作为资源配置的基础性手段的经济运行模式。()
完善民间投资的配套设施和实施细则,增加了民资的投资选择余地,对于缺乏投资渠道的民间资本可以起到_______作用,避免民间资本集中于住房、股票等_______的投资领域,也可激活民间的创业热情,弥补政府资金的不足。填入画横线部分最恰当的一项是:
下列关于外部网关协议BGP的描述中,错误的是()。
下列关于二叉树的叙述中,正确的是( )。
最新回复
(
0
)