单选题 C语言
题号 #2273989

有以下程序:
#include<stdio.h>
void exch(int t[])
{ t[0]=t[s];}
main(  )
{ int x[10]={1,2,3,4,5,6,7,8,9,10},i=0;
 while(i<=4){exch(&x[i]);i++;}
 for(i=0;i<5;i++)printf("%dl"x[i]);
 printf("\n");
}
程序运行后输出的结果是(  )。

进入在线模考

参考答案

D

答案解析

本题中exch函数是用数组中的第6个元素对第1个元素进行赋值,所以数组的值应该为6 7 8 9 10。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考