执行以下程序后,y的值是() main( ) { int a[]={2,4,6,8,10}; int y=1,x,*p; p=a[1]; for(x=0;x3;x++) y + = * (p + x); printf(""%d/n"",y); }A、17B、18C、19D、20

执行以下程序后,y的值是() main( ) { int a[]={2,4,6,8,10}; int y=1,x,*p; p=&a[1]; for(x=0;x<3;x++) y + = * (p + x); printf(""%d/n"",y); }

  • A、17
  • B、18
  • C、19
  • D、20

相关考题:

有如下程序:void main(){int x=2,y=3,a,b,c,d;a=(x++>=--y);b=(x==++y);c=(x--!=y);d=(++x>y--);}则程序执行后变量a,b,c,d的值分别是______。

若有以下程序: include using namespace std; int f(int x, int y) {return(y-x)*x; 若有以下程序:include <iostream>using namespace std;int f(int x, int y){return (y-x)*x;}int main(){int a=3,b=4,c=5,d;d=f(f(a,b) ,f(a,c) );cout<<d<<<end1;return 0;}执行后的输出结果是【 】。

以下程序段执行后y的值是【 】。x=7y=Int(x+0.6)Print y

以下程序执行后的输出结果是( )。include usingnamespacestd;void try(int,int,int,in 以下程序执行后的输出结果是( )。 #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<<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.不确定

以下程序执行后x的值是 main() { int x,y=252,i=386,*m=y,*z=i; x=(z==y); printf("%d",x);}A.252B.1C.0D.运行时出错,x无定值

有以下程序void f( int y, int *x){ y=y+*x; *X=*X+y; }main(){ int x=2,y=4;f(y,x);printf("%d %d\n",x,y);}执行后输出结果是______。

以下程序的执行结果是______。 inelude class Sample { public: int x; int y; void 以下程序的执行结果是______。inelude<iostream.h>class Sample{public:int x;int y;void disp( ){cout<<"x="<<x<<",y="<<y<<endl;}};void main( ){int Sample::*pc;Sample s;pc=Sample::x;s.*pc=10;pc=Sample::y;s.*pc=20;s.disp( );}

以下程序的执行结果是______。 include void main() { int x=5 y=2; cout 以下程序的执行结果是______。include<iostream.h>void main(){int x=5 y=2;cout<<! (y==x/2)<<",";cout<<(y!=x%3)<<",";cout<<(x>0 y<0=<<",";cout<<(x!=y||x>=y)<<endl;}

分析以下程序执行结果【】。 include int f (int x, int y){return x,y; } double f (d 分析以下程序执行结果【 】。include<iostream.h>int f (int x, int y){return x,y;}double f (double x, double y) {return x,y;}void main() {int a=4, b=6;double c=2.6, d=7.4;cout<<f (a, b) <<","<<f (c, d) <<end1;}

有以下程序段:includedefine MAX(x,y)(x)>(y)?(x):(y)void main(){ int i,j,k; i= 有以下程序段: #include<iostream.h> #define MAX(x,y)(x)>(y)?(x):(y) void main() { int i,j,k; i=10; j=15;k=MAX(i,j)*10; cout<<k<<end1; } 程序执行后的输出结果是( )。A.15B.100C.150D.10

有以下程序: main() { int y=10; while(y--); printf("y=%d\n",y); } 程序执行后的输出结果是( )。A.y=0B.y=-1C.y=1D.while构成无限循环

以下程序的执行后,x和y的值是 ______ 。 include class Sample { public: int x; 以下程序的执行后,x和y的值是 ______ 。 #include <iostream. h> class Sample { public: int x; int y; void disp() { cout<<"x="<<x<<", y="<<y<<end1; } }; void main() int Sample: :*pc; Sample s; pc=Sample:: x; s. *pc=10; pc=Sample: :y; s. *pc=.20; s. disp ();A.x=10, y=20B.x=20, y=10C.x=10, y=10D.x=20, y=20

有以下程序:int fun1 (double a){ return a * =a;}int fun2 ( double x, double y ){ double a=0,b=0; a = fun1 (x) ;b = fun1 (y); return(int) (a + b);} main() { doublew;w=fun2(1.1,2.0);……} 程序执行后变量w中的值是( )。A.5.21B.5C.5D.0

以下程序输出结果是 ______。includevoid fun(int x,int y,int z){z=x+y;}void main 以下程序输出结果是 ______。 #include<iostream.h> void fun(int x,int y,int z){z=x+y;} void main() { int a=10; fun (2,2,a); cout<<a; }A.0B.4C.10D.无定值

以下程序执行后x的值是()。includemain(){int x,y=252,i=386,*m=y,*z=i;x=(z 以下程序执行后x的值是( )。 #include <stdio.h> main() { int x,y=252,i=386,*m=y,*z=i; x=(z= =m); printf("%d",x); }A.252B.1C.0D.运行时出错,x无定值

有以下程序: int f1(doubleA){return a*a;} int f2(int x,int y) {double a,b; a=f1(x); b=f1(y); return a+b; } main() {double w; w=f2(2.1,4.0); } 程序执行后,变量w的值是( )。A.20.21B.20C.20.0D.0.0

以下程序的执行结果是 ______。 include int max(int x,int y) { ret 以下程序的执行结果是 ______。include<iostream.h>int max(int x,int y){return(x>y? x:y);}void main(){int n=2,m=10;max(n,m)--;cout<<"n="<<n<<",m="<<m<<endl;}

以下程序执行后输出的结果是【】。 include using namespace std; int fac(int a,int b){ 以下程序执行后输出的结果是【 】。include<iostream>using namespace std;int fac(int a,int b){return(b-a)*a;}int main(){int x=3,y=4,z=5,result;result=fac(fac(x,y),fac(x,z));cout<<result<<endl;return 0;}

执行以下程序后,y的值是 ( ) main( ) { int a [ ]={2,4,6,8,10); int y=1,x, *p; p=a[1]; for(x=0;x<3; x + +) y + =* (p + x); printf("%d\n",y); }A.17B.18C.19D.20

以下程序执行后的输出结果是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.不确定

有以下程序:includefun(int x,int y,int z){z=x*y;}main(){int a=4,b=2,c=6; fun(a,b, 有以下程序: #include <stdio.h> fun(int x,int y,int z) { z=x*y;} main() { int a=4,b=2,c=6; fun(a,b,c); printf("%d",c); } 程序运行后的输出结果是( )。A.16B.6C.8D.12

有以下程序:includo main(){int y=10; while(y--)printf("y=%d\n",y);} 程序执行后的 有以下程序: #includo <stdio.h> main() { int y=10; while(y--)printf("y=%d\n",y); } 程序执行后的输出结果是( )。A.y=0B.y= -1C.y=1D.while 构成无限循环

以下程序执行后的输出结果是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<<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.不确定

有以下程序main(){ int y=10;while(y--);printf("y= % d\n",y);}程序执行后的输出结果是A)y=0B)y=-1C)y=1D)while 构成无限循环

有以下程序      main( )  {int y=10;  while(y--);printf(”y=%d/n”,y);      }  程序执行后的输出结果是()A、y=0B、y=-lC、y=1D、while构成无限循环

单选题执行以下程序后,y的值是() main( ) { int a[]={2,4,6,8,10}; int y=1,x,*p; p=a[1]; for(x=0;x3;x++) y + = * (p + x); printf(""%d/n"",y); }A17B18C19D20

单选题有以下程序      main( )  {int y=10;  while(y--);printf(”y=%d/n”,y);      }  程序执行后的输出结果是()Ay=0By=-lCy=1Dwhile构成无限循环