程序分析题 阅读程序,写出运行结果 (1)下列程序的运行结果是 1 井include
void main( ) { char a[ ]={ 'a','b','c','d','e','f','g','h','\n'}; int x,y; x= sizeof(a) ; y= strlen(a); printf("%d,%d",x,y); (2)下列程序的运行结果是___2 井include < stdio.h> void fun(int b[3]) { int j; for(j=0;j<3;j++) { b[j]=j; } } void main( ) int a[3]={1.2,3},K; fun(a); for(k=0;k<3;k++) { printf(" %d" ,a[k]); } void } (3)下列程序的运行结果是__3 # include< stdio.h> int fun(int a,int b) { return(a+ b); } void main( ) { int x=2,y=3,z=4,r; r= fun(fun(x,y),z); printf("%d" ,r); } (4)下列程序的运行结果是__4 # include
void main( ) { char a[ ]="abcdef",b[ ]= "acdeea'; char *pl,*p2; int i; pl=a; p2=b; for(i=0;i<6;i++) { if(*(p1+i)! = * (p2 +i)) printf("%c",* (p1 +i)); } } (5)下列程序的运行结果是5 # include < stdio.h> void inv(int * p,int n) { int *i, *j,m=(n-1)/2,t; j=p+n-l; for(i=p;i