首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include <stdio.h> #define N 5 #define M N+1 #define f(x) (x*M) main() { int i1,i2; i1=f(2)
有以下程序 #include <stdio.h> #define N 5 #define M N+1 #define f(x) (x*M) main() { int i1,i2; i1=f(2)
admin
2010-09-05
15
问题
有以下程序 #include <stdio.h> #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/u7Wp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
设有如下的程序段:s=0i=1Whilei
(1)在考生文件夹下有一个工程文件sjt3.vbp。程序运行后,单击“读入数据”按钮,可把考生文件夹下in3.txt文件中的所有英文单词读入,并显示在Text1文本框中;单击“插入列表框”按钮,则按顺序把每个单词作为一项添加到List1列表框中(如图3.1
定义学生、教师和课程的关系模式S(s#,sn,Sd,Dc,sa)(其属性分别为学号、姓名、所在系、所在系的系主任、年龄);C(C#,Cn,P#)(其属性分别为课程号、课程名、先修课);SC(S#,C#,G)(其属性分别为学号、课程号和成绩),则该关系为(
(1)在考生文件夹下有一个工程文件sjt3.vbp。窗体上有名称为Timer1的定时器,以及两条水平直线,名称分别为Line1和Line2。请用名称为Shapel的形状控件,在两条直线之间画一个宽和高都相等的形状,设置其形状为圆,并设置适当属性使
设有下列语句:x=5Ifx>0Theny=1y=5程序运行后,则下列叙述中正确的是()。
窗体上有一个名称为Text1的文本框和一个名称为Command1的命令按钮,要求程序运行时,单击命令按钮(如图所示),就可以把文本框中的内容写至收件Out.txt中,每次写入的内容附加到文件原有内容之后。以下能正确实现上述功能的程序是()。
结构化程序所要求的基本结构不包括( )。
已知过程定义的首行为Subsum(aAsInteger,bAsInteger),则下面过程调用语句中正确的是()。
下列可作为VisualBasic变量名的是()。
下列选项中,不属于数据模型所描述的内容的是()。
随机试题
肺结核干酪样坏死转向愈合发生肾病综合征
在总图制图中,下列表示建筑物某点城市测量坐标的标注中()正确。
乙方能否就上述每项事件向甲方提出工期补偿和费用补偿要求?试简述其理由。该工程的实际施工天数为多少天?可得到的工期补偿为多少天?工期奖罚天数为多少天?
某混凝土工程,9月份计划工作量为5000m3,计划单价为400元/m3;而9月份已完成工作量为4000m3,实际单价为410元/m3,则该工程9月份的进度偏差为()万元。
根据现行消费税政策,关于消费税征税范围的说法,不正确的是()。
假设今天你参加招警面试时碰巧有一位考官曾是你的老师,并且他对你的评价一直不是很好,这对你的面试会有影响吗?
下列关于行政机关委托的组织的说法中正确的有()。
Writeanessayof160-200wordsbasedonthefollowingdrawing.Inyouressay,youshould1)describethedrawingbriefly,2)expl
Almosteveryfamilybuysatleastonecopyofanewspapereveryday.Somepeoplesubscribe(订阅)toasmanyastwoorthreenewspap
Intechnologymarkets,playingcatch-upisabruising,costlyandoften【B1】______game,evenforcorporategiants.Inamemo
最新回复
(
0
)