首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include<stdio.h> #include<string.h> struct A {int a;char b[10];double c;}; struct A f(struct A t);
有以下程序 #include<stdio.h> #include<string.h> struct A {int a;char b[10];double c;}; struct A f(struct A t);
admin
2018-09-26
23
问题
有以下程序
#include<stdio.h>
#include<string.h>
struct A
{int a;char b[10];double c;};
struct A f(struct A t);
main()
{struct A a={1001,"ZhangDa’’,1098.0);
a=f(a);printf(’’%d,%s,%6.1f\n",a.a,a.b,a.c);
}
struct A f(struct A t)
{ t.a=1002;
strcpy(t.b,’’Wangaeng’’);t.c=1220.0;return t;}
程序运行后的输出结果是( )。
选项
A、1001,ZhangDa,1098.0
B、1002,ZhangDa,1220.0
C、1001,WartgPeng,1098.0
D、1002,WangPeng,1220.0
答案
D
解析
在主函数中定义结构体A的变量a,并对其赋初值,再调用函数f(a),在函数f(a)中对结构体变量a的各个成员重新进行了赋值操作,并把其值返回在屏幕上输出。
转载请注明原文地址:https://jikaoti.com/ti/jEa0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下述函数功能是______。intfun(char*x){char*y=x;while(*y++);retumy-x-1;}
下列程序执行后输出的结果是______。intd=1;fun(intp){intd=5;d+=p++;printh("%d,",d);}main(){
以下程序的输出结果是______。#include<stdio.h>main(){inta[5]={2,4,6,8,10},*p;p=a;p++;printf("%d",*p);}
若fp是指向某文件的指针,且已读到文件末尾,则函数feof(fp)的返回值是
数据独立性是数据库技术的重要特点之一,所谓数据独立性是指 _____。
设有以下语句,则c的二进制值是() chara=3,b=6,c; c=ab<<2;
下面程序的功能是:将字符数组a中下标值为偶数的元素从小到大排列,其他元素不变。请填空。#include#includemain(){chara[]="clanguage",t;inti,j,k;k=strlen(a);f
一个良好的算法由下面的基本结构组成,但不包括______。
检查软件产品是否符合需求定义的过程称为
随机试题
推进人的全面发展同推进经济、文化的发展之间的关系是()
内呼吸是指
男,35岁。右下8近中位阻生,右下7远中颈部可疑龋坏。现拟拔除右下8在翻瓣去骨拔除阻生的右下8后3天,患者出现拔牙窝持续性疼痛,并向耳颞部放射。检查见拔牙窝内无血凝块,牙槽骨壁表面有灰白色假膜覆盖,有明显臭味。诊断应为
女性,19岁,农民。12月在水利工地上突起发热,伴头痛,眼眶痛,腰痛。病程第四日就诊时热已退,血压偏低,球结膜水肿,出血,胸背部见条索点状瘀点。前一日24小时尿量340mL,该病例最可能的诊断是
E公司于2012年发现;2011年漏记了一项固定资产折旧费用180000元,所得税申报表中也没有扣除这笔费用。该公司适用所得税税率为25%,法定盈余公积计提比例为10%。此项差错属于重大会计差错。则该项差错使2012年未分配利润的年初数减少()元。
国家风险通常是由债务人所在国家的行为引起的,超出了债权人的控制范围。( )
下面的组织结构图属于()。
属于会计要素的收入的项目有()。
某商店花10000元进了一批商品,按期望获得相当于进价25%的利润来定价,结果只销售了商品总量的30%。为尽快完成资金周转,商店决定打折销售,这样卖完全部商品后,亏本1000元。问商店是按定价打几折销售的?()
在Java语言的所有方法中,比较特殊的一类方法是抽象方法,它只有方法头,而没有______。
最新回复
(
0
)