首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #define PT 3.5; #define S(x) PT*x*x ; main() { int a=1,b=2; print=f("%4.1 f\n",S(a+b));} 程序运行后的
有以下程序 #define PT 3.5; #define S(x) PT*x*x ; main() { int a=1,b=2; print=f("%4.1 f\n",S(a+b));} 程序运行后的
admin
2019-06-09
13
问题
有以下程序
#define PT 3.5;
#define S(x) PT*x*x ;
main() {
int a=1,b=2;
print=f("%4.1 f\n",S(a+b));}
程序运行后的输出结果是
选项
A、31.5
B、7.5
C、程序有错无输出结果
D、14.0
答案
C
解析
本题考查宏定义。预处理语句后面不能加分号,因此程序有错。如果没加分号的话S(a+b)=PT*a+b*a+b=3.5*1+2*1+2=7.5。
转载请注明原文地址:https://kaotiyun.com/show/cCRp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
给定程序中,函数fun的功能是:将形参指针所指结构体数组中的三个元素按num成员进行升序排列。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下的BLANKl.C中。不得增行或
请编写函数fun,它的功能是:求出1到1000之间能被7或11整除、但不能同时被7和11整除的所有整数并将它们放在a所指的数组中,通过n返回这些数的个数。注意:部分源程序在文件PROGl.C中。请勿改动主函数main和其他函数中的任何内
给定程序MODll.C中函数fun的功能是:删除P所指字符串中的所有空白字符(包括制表符、回车符及换行符)。输入字符串时用‘#’结束输入。请改正程序中的错误,使它能输出正确的结果。注意:不要改动main函数,不得增行或删行,也
请编写一个函数fun,它的功能是:求出1到m之间(含m)能被7或11整除的所有整数放在数组a中,通过n返回这些数的个数。例如,若传送给m的值为50,则程序输出:711142122283335424449
给定程序中,函数fun的功能是:对形参SS所指字符串数组中的M个字符串按长度由短到长进行排序。SS所指字符串数组中共有M个字符串,且串长
给定程序中,函数fun的功能是:在带有头结点的单向链表中,查找数据域中值为ch的结点。找到后通过函数值返回该结点在链表中所处的顺序号;若不存在值为ch的结点,函数返回0值。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。
如果需要打开一个已经存在的非空文件“FILE”并进行修改,正确的语句是()。
下列叙述中正确的是()。
下列关于二叉树的叙述中,正确的是()。
有如下程序#includemain(){charname[10]={’S’,’T’,’R’,’I’,’N’,’G’};name[3]=’E’;name[5]=0;printf("%s\n",name);}程序
随机试题
骨髓涂片在低倍显微镜下就容易识别的细胞种类是
男17岁,患ALL,经化疗后已完全缓解3个月,但最近发现右侧睾丸无痛性肿大,骨髓检查仍正常,诊断为睾丸白血病。针对该病的治疗措施是()(2005年)
对于设备的有形和无形磨损,下列说法错误的是()。
进口食品经营企业在批发、零售进口食品时应持有当地检验检疫机构签发的进口食品卫生证书。( )
根据车船税法律制度的规定,下列车船中,应征收车船税的是()。
华星公司成立于2011年,是一家致力于汽车零配件研发、生产及销售的公司。2015年公司拟实行全面预算管理体系,并于2015年底由财务总监牵头各部门负责人成立预算管理小组,该小组根据公司的发展战略和经营计划直接编制2016年年度预算草案,由总经理审核通过并下
让学生感受生命的可贵,养成自尊自信、乐观向上、意志坚强的人生态度。这属于思想品德课程目标中的()。
下列关于社会工作和社会保障的区别,说法错误的是()。
阅读以下文字,完成以下小题。地衣是植物界中结构奇特、与众不同的一个大家族,它分泌的地衣酸可腐蚀岩石,对土壤的形成起着开拓作用。堪称不毛之地的“拓荒先锋”。长期以来,地衣的结构都是不解之谜。直到1867年,德国植物学家西蒙.释义德奈尔才揭
TheBermudaTriangle(百莫大三角区)isoneofthegreatestmysteriesofthesea.ItissaidthatChristopherColumbuswasthefirstpe
最新回复
(
0
)