首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include <stdio.h> void f(int y,int *x) { y=y+ *x; *x=*x+y;} main() { int x=2,y=4; f(y,&x);
有以下程序: #include <stdio.h> void f(int y,int *x) { y=y+ *x; *x=*x+y;} main() { int x=2,y=4; f(y,&x);
admin
2013-02-23
18
问题
有以下程序:
#include <stdio.h>
void f(int y,int *x)
{ y=y+ *x; *x=*x+y;}
main()
{ int x=2,y=4;
f(y,&x);
printf("%d%d\n",x,Y);
}
执行后的输出结果【 】。
选项
答案
8 4
解析
f函数中变量x传的是变量的地址,而变量y是传的值,调用函数f后,虽然f函数中的。x变为8,y值也变了,但main函数中的y未变,仍然为4。
转载请注明原文地址:https://kaotiyun.com/show/SBJp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
请读程序:#include<stdio.h>#include<string.h>main(){char*s1="AbCdEf",*s2="aB";s1++;s2++;printf("%d\n
将E-R图转换到关系模式时,实体与联系都可以表示成______。
在调用函数时,如果实参是简单变量,它与对应形参之间的数据传递方式是()
一个类可以从直接或间接的祖先中继承所有属性和方法。采用这个方法提高了软件的【】。
软件工程研究的内容主要包括:【】技术和软件工程管理。
按条件f对关系R进行选择,其关系代数表达式为______。
下列数据模型中,具有坚实理论基础的是
下列选项中,不是关于栈的基本运算的叙述是______。
软件文档不仅是软件开发各阶段的重要依据,而且也影响软件的______。
已知二叉树BT的后序遍历序列是dabec,中序遍历序列是debac,它的前序遍历序列是______。
随机试题
Overcomingsetbackstakestime,effortsandperseverance.
患者,女,40岁。自营卖油漆以及上门刷油漆服务,经营已有12年,近期健康体检中发现白细胞3.6×109/L,中性粒细胞1.8×109/L,血小板77×109/L,根据化验结果可诊断为()
下列关于球团干燥窑安全控制措施的说法,错误的是()。
项目质量控制体系运行的核心机制是()。
某市一家彩电生产企业,为增值税一般纳税人。适用企业所得税税率25%。2013年生产经营业务如下:(1)全年直接销售彩电取得销售收入8000万元(不含换取原材料的部分),全年购进原材料,取得增值税专用发票,注明税款850万元(已通过主管税务机关认证)。(
根据《民法典》,孙子女、外孙子对祖父母、外祖父母履行赡养义务包括()。
A小区王某等住户因车位问题与该小区的开发商B公司发生争议。B公司与王某等住户的购房合同规定:B公司将为本楼住户提供地下停车场的停车车位。但王某等住户搬进小区后,发现B公司已将该楼50多套房连同地下停车场卖给了C公司。C公司明确表示,地下停车场的车位仅供本楼
结构化程序所要求的基本结构不包括
非成员函数只有在声明为类的____________时才能访问这个类的所有private成员。
Thecouncilofanimalsappeared______.Theanimalsenjoyed______.
最新回复
(
0
)