首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: int*f(int*x,int*y) { if(*x<*y) return x; else return y; } main() { int a=7,b=8,*P,*q,*r;
有以下程序: int*f(int*x,int*y) { if(*x<*y) return x; else return y; } main() { int a=7,b=8,*P,*q,*r;
admin
2010-09-05
23
问题
有以下程序: int*f(int*x,int*y) { if(*x<*y) return x; else return y; } main() { int a=7,b=8,*P,*q,*r; P=&a; q=&b; r=f(p,q); print("% d,% d,% d\n",*P,*q,*r); } 执行后的输出结果是 ______。
选项
A、7,8,8
B、7,8,7
C、8,7,7
D、8,7,8
答案
B
解析
函数f是一个返回值为指针的函数,其功能是比较两个数中的最小值,并返回最小值的存储单元地址。main函数中定义了指针变量p和q,p=&a,q=&b,即*p=7,*q=8,调用函数{后r=p,所以*r=7,printf函数的输出结果为 7,8,7。
转载请注明原文地址:https://kaotiyun.com/show/LOWp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
设有如下程序:PrivateSubInv(ByValxStrAsString,yStrAsString)DimtStrAsStringDimLAsIntegerL=Len(xStr)
若看到程序中有以下事件过程,则可以肯定的是,当程序运行时()。PrivateSubCliek—MouseDown(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)
软件测试的目的是()。
软件设计中划分模块的一个准则是()。
以下关于过程及过程参数的描述中,错误的是( )。
为了保存数据,需打开顺序文件"E:\UserData.txt",以下正确的命令是
考生文件夹下有工程文件sjt5.vbp和数据文件in5.txt。in5.txt中有多条记录,每条记录占一行,含4个数据项,数据项的含义依次是:姓名、数学成绩、语文成绩、英语成绩。程序运行时,会把in5.txt中的所有记录读入数组a中(每个数组元素是一条记录
软件按功能可以分为:应用软件、系统软件和支撑软件(或工具软件)。下面属于应用软件的是( )。
下列选项中,不属于数据管理员(DBA)职责的是()。
若在窗体模块的声明部分声明了如下自定义类型和数组PrivateTypeTemScoreAsIntegerStrNameAsStringEndTypeDimStudent(5)AsTem
随机试题
某企业拟筹资金实施一项技术改造项目,内容为新建一套加工装置,该装置建设投资25000万元,计算期6年(建设期1年,运营期5年),新装置所需流动资金5000万元,全部运营期第1年投入。假设该装置投资所含增值税可在其建设期内由原企业抵扣,忽略其带来的影响。新装
排水固结法分为堆载预压法和真空预压法两类,用于加固()。
黄疸消退后调治肝脾不调证的代表方剂是( )
A.骨髓巨核细胞增多伴成熟障碍B.骨髓巨核细胞增多无成熟障碍C.骨髓巨核细胞明显减少D.骨髓原始巨核细胞≥0.30(非红系细胞)E.骨髓可见较多的小巨核细胞原发性血小板增多症()
人身保险合同中由投保人指定的,在保险事故发生后享有保险赔偿与保险金请求权的人是()。
注重以服务对象为中心,创造一种有利于服务对象自我发展的辅导环境的个案工作模式是()。
阅读下面文字,回答有关问题:《普通高中化学课程标准(实验)》中有这样的表述:结合人类探索物质及其变化的历史与化学科学发展的趋势,引导学生进一步学习化学的基本原理和基本方法,形成科学的世界观。问题:结合高中化学某一内容的教学,举例说明如何借助化学史开
A、 B、 C、 D、 D黑点个数每次增加2,圆圈个数每次减少2。
恩格斯说:“……他用这本书来向自然事务方面的教会权威挑战。从此自然科学便开始从神学中解放I叶j来……”。引文中的“他”和“这本书”指的是()。
简述人本主义心理学的基本观点。
最新回复
(
0
)