首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include #include struet A { int a; char b[10]; double c; }; struct A f(struet A t);
有以下程序: #include #include struet A { int a; char b[10]; double c; }; struct A f(struet A t);
admin
2021-06-15
21
问题
有以下程序:
#include
#include
struet A
{
int a;
char b[10];
double c;
};
struct A f(struet A t);
main( )
{
8truet A at={1001,"ZhangDa",1098.0};
a=f(a);
printf("%d,%s,%6.1f\n",a.a,a.b,a.c);
}
struet A f(struet A t)
{
t.a=1002;
strepy(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
解析
本题考查结构体变量的引用以及作为函数参数的用法。题目虽然看似复杂,其实比较容易,f函数的参数是结构体变量,然后对参数重新赋值并返回,所以该题目的答案为B选项。
转载请注明原文地址:https://kaotiyun.com/show/yAtp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
给定程序MODI1.C中,函数fun的功能是判断整数n是否是“完数”。当一个数的因子之和恰好等于这个数本身时,就称这个数为“完数”。例如:6的因子包括1、2、3,而6=1+2+3,所以6是完数。如果是完数,函数返回值为1,否则函数返回值为0。数组a中存放的
给定程序中已建立一个带有头结点的单向链表,在main函数中将多次调用fun函数,每调用一次fun函数,输出链表尾部结点中的数据,并释放该结点,使链表缩短。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下
有以下程序:#include<stdio.h>#define5+6main(){inta=2,c;C=x*2:printf("%d",c);}程序运行后的输出结果是()。
有以下程序:#include<stdio.h>main(){intc;while((c=getchar())!=’\n’){switch(c-’3’){case0:case1:putchat(c+4);case2:putchar(c+4)
下列各选项中,不属于序言性注释的是()。
有以下程序#defineF(X,Y)(X)*(Y)main(){inta=3,b=4;printf("%d\n",F(a++,b++));}程序运行后的输出结果是()。
有以下程序:#include<stdio.h>main(){┋while(getchar()!=’\n’);┋}以下叙述中正确的是()。
以下选项中合法的标识符是
软件按功能可以分为应用软件、系统软件和支撑软件(或工具软件)。下面属于应用软件的是
随机试题
512102×7.0-DW型螺杆钻具是()。
关于吸烟与牙周炎治疗、预后,下列哪项说法错误
2001年12月,正大公司应缴企业所得税18万元,但因征税人员工作失误,只征收了16万元。2004年1月,税务机关要求该公司补缴2001年少缴的2万元税款,并加收滞纳金。该公司拒绝补缴,并提出公司发现2000年1月公司应缴纳企业所得税20万元,由于公司财务
下列关于土石路堤的施工要领阐述有误的是( )。
物流公司内部资源是物流能力,丽在物流需求方公司里,物流仅仅是众多业务领域中的一小部分。
某服务对象觉得自己的生活不如意,没有什么指望。社会工作者回应:“在您的生活中,哪些事情让您觉得自己没有指望了?”社会工作者的回应运用了会谈技巧中的()。
战国时期的风诡云谲之中,士争雄、国争霸的社会场景在历史上留下的画卷之繁复、之错综、之精彩、之生动,的确是罕见的。而提及战国,自然要提及名噪一时的乱世枭雄——“四君子”:齐之孟尝、赵之平原、魏之信陵、楚之春申。他们广养门客,苦心经营,倡合纵,拒强秦,确是做了
以下叙述中不正确的是()。
汇编语言是一种()。
A、Freeandqualityeducationforall.B、Nointerventionineducationbythegovernment.C、Morefreedomofeducationforchildren
最新回复
(
0
)