#include void sub(float x,float *y,float *z){*y=*y-1.0;*z=*z+x;}void main(){float a=2.5,b=9.0,*pa,*pb;pa=&a;pb=&b;sub(b-a,pa,pa);printf("%g\n",a);}
查看答案
以下程序的运行结果是 。#include int f(int b[],int n){int i,r=1;for (i=0;i<=n;i++)r=r*b[i];return r;}void main(){int x,a[]={2,3,4,5,6,7,8,9};x=f(a,3);printf("%d\n",x);}
以下程序的运行结果是 。#include void func(int b[]);void main(){int a[]={5,6,7,8},i;func(a);for (i=0;i<4;i++)printf("%d ",a[i]);printf("\n");}void func(int b[]){int j;for (j=0;j<4;j++)b[j]=2*j;}
以下程序的运行结果是 。#include int func(int a,int b){int c;c=a+b;return c;}void main(){int x=6,y=7,z=8,r;r=func((x--,y++,x+y),z--);printf("%d\n",r);}
以下程序的运行结果是 。#include #include int fact(){static int i=5;if (i==0) return 1;else{i--;return (i+1)*fact();}}void main(){printf("fact=%d\n",fact());}