首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include<stdio.h> #include<string.h> structA { int a;char b[10];double c;); structA f(structA t);
有以下程序: #include<stdio.h> #include<string.h> structA { int a;char b[10];double c;); structA f(structA t);
admin
2019-01-11
19
问题
有以下程序:
#include<stdio.h>
#include<string.h>
structA
{ int a;char b[10];double c;);
structA f(structA t);
main()
{ structAa={1001,"ZhangDa",1098.0);
a=f(a);printf("%d,%s,%6.1 f\n",a.a,a.b,a.c);
}
structAf(structA t)
{ t.a=1002;strcpy(t.b,"ChangRong");t.c=1202.0;return t;}
程序运行后的输出结果是( )。【09年9月】
选项
A、1001,ZhangDa,1098.0
B、1002,ZhangDa,1202.0
C、1001,ChangRong,1098.0
D、1002,ChangRong,1202.0
答案
D
解析
在主函数中定义结构体A的变量a,并对其赋初值,再调用函数f(a),在函数f(a)中对结构体变量a的各个成员重新进行了赋值操作,并把其值返回在屏幕上输出。
转载请注明原文地址:https://kaotiyun.com/show/hixp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
以下程序输出的最后一个值是【】。intff(intn){staticintf=1;f=f*n;returnf,}main(){inti;for(i=1;i<=5;i+
表示关系x≥y≥z应使用C语言表达式()
线性表若采用链式存储结构时,要求内存中可用存储单元的地址______。
关系表达式x<y<z,用C语言的表达式为【】。
下面关于完全二叉树的叙述中,错误的是______。
数据元素之间【】的整体称为逻辑结构。
下列选项中,不属于数据管理员(DBA)职责的是()。
给定程序通过定义并赋初值的方式,利用结构体变量存储了一名学生的学号、姓名和3门课的成绩。函数fun的功能是将该学生的各科成绩都乘以一个系数a。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文
在面向对象方法中,属性与操作相似的一组对象称为【】。
栈和队列的共同特点是
随机试题
A________analysisofanutterancewillrevealwhatthespeakerintendstodowithit.()
“治上消者,宜润其肺,兼清其胃”,“治中消者,宜清其胃,兼滋其肾”,“治下消者,宜滋其肾,兼补其肺”出自于哪部医学著作
属于电解质盐析作用而产生沉淀的有
按照美国PSI指数原理建立的我国大气质量指数是()
建设单位就专业分包工程存在的施工质量缺陷提起民事诉讼,根据《民事诉讼法》及相关司法解释,建设单位可以将( )列为共同被告。
向银行借款购买原材料,属于()。
总分类账户发生额及余额试算表中本期借方发生额合计数等于本期贷方发生额合计数,说明账户发生额记录()。
有些国家建立关税同盟,这些成员国的关境是()。
A、Colleagues.B、Schoolmates.C、Teacherandstudent.D、Doctorandpatient.B对话开头,男士说自他们毕业到现在已经十年了,接着两人谈论了他们最近的工作状况。由此推断,两人以前应该是同学
A、Becausehethoughthewastedmuchtime.B、Becausehedoesn’tunderstandthewoman’sexplanation.C、Becausehewatchedonlyone
最新回复
(
0
)