首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include<stdio.h> void fun(int a,int b) { int t; t=a;a=b;b=t; } main() { int c[10]={1,2,3,4,5,6,7,8,9,0},i; for(i=0;i<10;
有以下程序: #include<stdio.h> void fun(int a,int b) { int t; t=a;a=b;b=t; } main() { int c[10]={1,2,3,4,5,6,7,8,9,0},i; for(i=0;i<10;
admin
2021-02-25
20
问题
有以下程序:
#include<stdio.h>
void fun(int a,int b)
{
int t;
t=a;a=b;b=t;
}
main()
{
int c[10]={1,2,3,4,5,6,7,8,9,0},i;
for(i=0;i<10;i+=2)
fun(c
,c[i+1]);
for(i=0;i<10;i++)
printf("%d",c
);
printf("\n");
}
程序的运行结果是( )。
选项
A、1 2 3 4 5 6 7 8 9 0
B、2 1 4 3 6 5 8 7 0 9
C、0 9 8 7 6 5 4 3 2 1
D、0 1 2 3 4 5 6 7 8 9
答案
A
解析
函数fun()属于值传参,形参的变化不会影响实参,所以函数调用结束后,数组c没有任何变化,输出结果为选项A。
转载请注明原文地址:https://kaotiyun.com/show/Imtp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
软件设计中模块划分应遵循的准则是( )。
有以下程序(strcat函数用以连接两个字符串)#include#includemain(){chara[20]="ABCD\0EFG\0",b[]="IJK";strcat(a,b);printf("%s\n",a);}程序运行后
有三个关系R、S和T如下:由关系R和S通过运算得到关系T,则所使用的运算为
设有定义:intx=2;以下表达式中,值不为6的是()。
在数据库设计中,将E-R图转换成关系数据模型的过程属于
i若已定义:inta[]={0,1,2,3,4,5,6,7,8,9},*p=a,i;其中0≤i≤9,则对a数组元素不正确的引用是()。
定义学生、教师和课程的关系模式S(S#,Sn,Sd,Dc,Sa)(其属性分别为学号、姓名、所在系、所在系的系主任、年龄);C(C#,Cn,P#)(其属性分别为课程号、课程名、先修课);SC(S#,C#,G)(其属性分别为学号、课程号和成绩)。包含对非主属性
设循环队列的存储空间为Q(1:35),初始状态为front=rear=35。现经过一系列入队与退队运算后,front=15,rear=15,则循环队列中的元素个数为
有以下程序#includestructS{inta;intb;};main(){structSa,*p=&a;a.a=99;printf("%d\n",_______);}程序要求输出结构体中成员a的数据,以下不能填入横线处的内容是
关系的实体完整性要求关系中不能为空的属性是()。
随机试题
雨天安全行车的注意事项是什么?
呼吸道具有
中国目前房地产代理活动的主要形式为()。
施工方案经济分析的常用方法是什么?设备负荷试运转应怎样来组织?
当无圈梁和梁垫时,板、次梁与主梁交叉处,其上层钢筋的绑扎位置正确的是()。
在运用控制小组进程技巧时,工作者要针对组员的语言行为及背后的思想适当给出解释,这样做的目的是()。
阅读《济南的冬天》的教学实录片段,回答问题。(总结部分)师:现在我们已经领略了济南这个城市冬天的美妙了,最后让我们一起来总结一下这篇文章每一段的主旨。谁能告诉我,第一段主要写了什么?生:写了济南作为一个北方城市却能拥有一个温暖
我国古代“皇帝”作为国家元首的正式称号,始于()。
公安工作是政策性和法律性相结合的一项工作。()
Thelasthalfofthenineteenthcentury_____thesteadyimprovementinthemeansoftravel.
最新回复
(
0
)