首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include #include StructA { int a;char b[10];double c;}; struct A f(struct At); main() {struc
有以下程序 #include #include StructA { int a;char b[10];double c;}; struct A f(struct At); main() {struc
admin
2019-05-17
13
问题
有以下程序
#include
#include
StructA
{ int a;char b[10];double c;};
struct A f(struct At);
main()
{struct A a={1001,"ZhangDa",1098.0};
al=f(a);printf("%d,%s,%6.1f\n",a.a,a,b,a.c);}
struct A f(Struct A t)
{t.a=1 002;strcpy(t.b,"ChangRong");t.c=1202.0;return t;}
程序运行后的输出结果是
选项
A、1002,ZhangDa,1202.0
B、1002,ChangRong,1202.0
C、1001,ChangRong,1098.0
D、1001,ZhangDa,1098.0
答案
B
解析
在主函数中定义结构体A的变量a,并对其赋初值,再调用函数f(a),在函数f(a)中对结构体变量a的各个成员重新进行了赋值操作,并把其值返回在屏幕上输出。
转载请注明原文地址:https://kaotiyun.com/show/BJRp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序,程序中库函数islower(ch)用以判断ch中的字母是否为小写字母#include#includevoidfun(char*p){inti=0;while(p[i]){i
下列定义数组的语句中,正确的是
有下列程序:#includemain(){FILE*fp;inta[10]={1,2,3},i,n;fp=fopen("d1.dat","w");for(i=0;i<3;
若有以下程序main(){intc:c=10^5:printf("%d\n",c);}则程序的输出结果是
以下选项中关于C语言常量的叙述错误的是
函数fun的功能是进行数字字符转换。若形参ch中是数字字符‘0’~‘9’,则‘0’转换成‘9’,‘1’转换成‘8’,‘2’转换成‘7’,……,‘9’转换成‘0’;若是其他字符则保持不变;并将转换后的结果作为函数值返回。请在程序的下划线处填入正确的
一个栈的初始状态为空。现将元素A,B,C,D,E依次入栈,然后依次退栈三次,并将退栈的三个元素依次入队(原队列为空),最后将队列中的元素全部退出。则元素退队的顺序为()。
公司中有多个部门和多名职员,每个职员只能属于一个部门,一个部门可以有多名职员。则实体部门和职员间的联系是
构成计算机软件的是
按照C语言规定的用户标识符命名规则,不能出现在标识符中的是
随机试题
(2021年临沂)国老师认为,教学方法的选用既要看内容,更要考虑这堂课你要达到什么成果,如果要让学生形成某种情感态度,情感陶冶法是首选,如果要让学生记住一些基本知识的话,讲授法效率高……从国老师的谈话中我们能够看出,对教学方法的选用其关注点在于()
智齿冠周炎的临床表现中,不正确的是
企业在职工劳动合同到期之前解除与职工的劳动关系而给予职工的经济补偿应通过职工薪酬核算。()
用方差—协方差法计算VaR时,其基本假设之一是时间序列不相关。若某序列具有趋势特征,则真实VaR与采用方差一协方差法计算得到的VaR相比()。
H啤酒公司成功地在一个拥有300万人口的C市收购了一家啤酒厂,不仅在该市取得了95%以上市场占有率,而且在全省的市场占有率也达到了60%以上,成了该省啤酒业界名副其实的龙头老大。C市100公里外的雪花啤酒公司,3年前也是该省的老大。然而,最近雪花啤酒因经
Excel2003单元格区域A1:E2中的数据如下表所示,先在单元格Fl中输入公式“=SUM(A1:E1)”其值显示为15,若要求用函数计算使单元格F2中的值仍为15,则在单元格F2中可输入公式()。
中东地区拥有的探明石油储量占到全球探明石油总储量的()。
Forachild,happinesshasamagicalnature.Iremembermakinghide-outsinnewly-cuthay,playingcopsandrobbersinthewoods
Negotiationisnotlimitedtothecorporateboardroomortohigh-stakesbusinesssettings.Bybecomingfamiliarwithsimplenego
America’smorecapitalistsportsfanscommonlyacknowledgethattheircountry’smostpopularsports,liketheNationalFootball
最新回复
(
0
)