选择题
有以下程序
#include<stdio.h>
void fun(int*p,int*q)
{ int t;
t=*p;*p=*q;*q=t;
*q=*p;
}
main()
{ int a=0,b=9;
fun(&a,&b);
pfintf('%d%d\n',a,b);
}
程序的输出结果是______。
A、
9 9
B、
0 0
C、
9 0
D、
0 9
【正确答案】
A
【答案解析】
fun函数完成的功能是将两个数交换,然后再将第一个数赋值给第二个数,main中调用后a b分别为9 9,答案选择A。
提交答案
关闭