题目内容

运行以下程序,输入100,其输出结果是 。#include void func(int n){int i;for (i=n-1;i>=1;i--)n=n+i;printf("n=%d\n",n);}main(){int n;printf("输入n:");scanf("%d",&n);func(n);printf("n=%d\n",n);}

查看答案
更多问题

以下程序的运行结果是 。#include main(){int swap();extern int a,b;a=3;b=10;swap();printf("a=%d,b=%d\n",a,b);}int a,b;swap(){int temp;temp=a;a=b;b=temp;}

#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;}

答案查题题库