下面程序的输出结果是( ) func(int x) { static int a=2; return(a+=x);} rnain() { int b=2,c=4,d; d=func(b) ; d=func(c) ; printf("%d\n",d) ;}A.4B.6C.8D.12

下面程序的输出结果是( ) func(int x) { static int a=2; return(a+=x);} rnain() { int b=2,c=4,d; d=func(b) ; d=func(c) ; printf("%d\n",d) ;}

A.4

B.6

C.8

D.12


相关考题:

有以下程序:includeusing namespace std;int f(int,int);int main(){ int i:1,x; x=f 有以下程序: #include<iostream> using namespace std; int f(int,int); int main() { int i:1,x; x=f(i,i+1); cout<<x<<end1; return 0; } int f(int a,int b) { int c; c = a; if(a>b) c = 1; else if(a==b) c = 0; else c = -2; return c; } 运行后的输出结果是( )。A.1B.0C.-1D.-2

下面程序的输出结果是【】。 include using namespace std; int x; void funA(int,i 下面程序的输出结果是【 】。include<iostream>using namespace std;int x;void funA(int,int);void funB(int,int);int main(){int first;int second=5;x=6;funA(first,seconD) ;fimB(first,seconD) ;cout<<first<<" "<<second<<" "<<x<<end1;return 0;}void funA(int a,int B){int first;first=a+b;a=2*b;b=first+4;}void funB(int u,int v){int second;second=x;v=second+4;x=u+v;}

下面程序的输出结果是______。 include using namespace std; int x; void funA(int,int);void funB(int,int);int main(){int first;int second=5;x=6;funA(first,second);funB(first,second);cout<<first<<””<<second<<””<<x<<endl;return 0;}void funA(int a,int b){int first;first=a+b;a=2*b;b=first+4;}void funB(int u, int v){int second;second=x;v=second+4;x=u+v;}

下列程序的输出结果是includeint b=2;int func(int *a) {b+=*a;return(b) ;}void m 下列程序的输出结果是 #include<iostream.h> int b=2; int func(int *a) {b+=*a;return(b) ;} void main( ) { int a=2,res=2; res+=func(a) ; cout<<res;}A.4B.6C.8D.10

下列程序的输出结果是includeint b=2;int func(int * a){b+= * a; return(b) ;}voi 下列程序的输出结果是 #include<iostream.h> int b=2; int func(int * a) {b+= * a; return(b) ;} void main( ) { int a=2, res=2; res+=func(a) ; cout < < res;}A.4B.6C.8D.10

以下程序执行后的输出结果是include using namespace std;void try(int,int,int,int) 以下程序执行后的输出结果是 #include <iostream> using namespace std; void try(int,int,int,int); int main () { int x,y,z,r; x =1 ; y = 2; try(x,y,z,r); cout<<r<<endl; return 0; } void try(int x,int y,int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

有以下程序: int fa(int x) { return x*x; } int fb(int x) { return x*x*x; } int f(int (*f1)(),int (* f2)(),int x) { return (*f2)(x)-(*f1)(x); } main() { int i; i=f(fa,fb,2); printf("%d\n",i); } 程序运行后的输出结果是( )A.-4B.1C.4D.8

以下程序执行后的输出结果是includeusing namcspace std;void try(int,int,int,int); 以下程序执行后的输出结果是 #include<iostream> using namcspace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

下列程序的输出结果是inClUdeiht b=2;int funC (int*a) { b+=*a;return(b);}void m 下列程序的输出结果是 #inClUde<iostream.h> iht b=2; int funC (int*a) { b+=*a;return(b);} void main() { inta=2,res=2; res+=func(a); cout<<res;}A.4B.6C.8D.10