55. int []x= {1, 2,3,4, 5};  56. int y[] =x;  57. System.out.println(y[2]);  Which is true?() A、 Line 57 will print the value 2.B、 Line 57 will print the value 3.C、 Compilation will fail because of an error in line 55.D、 Compilation will fail because of an error in line 56.

55. int []x= {1, 2,3,4, 5};  56. int y[] =x;  57. System.out.println(y[2]);  Which is true?() 

  • A、 Line 57 will print the value 2.
  • B、 Line 57 will print the value 3.
  • C、 Compilation will fail because of an error in line 55.
  • D、 Compilation will fail because of an error in line 56.

相关考题:

有以下程序int fa(int x){return x*x;}int fb(int x){return x*x*x;}int f(int(*fl)(),int(*f2)(),int x}{return f2(x)-f1(x);}main(){int i;i=f(fa,fb,2);printf("%d\n",i);}程序运行后,输出结果是【 】。

有如下程序:include void fun (int x,int y){int t=x;x=y;y=t;}int main(){ int 有如下程序: #include <iostream> void fun (int x,int y){int t=x;x=y;y=t;} int main() { int a[2]={23,42}; fun (a[1],a[0]; std::cout<<a[0]<<”,”<<a[1]<<std:: ond1; retum0; }执行后的输出结果是______ 。A.41,41B.23,23C.13,42D.42,23

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

有以下程序: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 int f(int); void main() { int x=1,i; for (i=0; i 下面程序的结果【 】。include<iostream.h>int f(int);void main() {int x=1, i;for (i=0; i<3; i++)cout<<f(x)<<‘ ’ ;cout<<end1;}int f(int x){int y=1;static int z=3y++;z++;return (x+y+z);}

以下程序的输出的结果是( )。int x=3;main(){ int i;for(i=1;i<x;i++)incre();}incre(){ staic int x=1; x*=x+1; printf(" %d", x);}A.33B.22C.26D.25

有如下程序: include using namespace std; void f1(int x, int y){int z= 有如下程序:#include<iostream>using namespace std;void f1(int x, int y){int z=x; x=y; y=z;)void f2(int x, int y){int z=x; x=y; y=z;}intmain(){int x=10, y=26;f1(x, y);f2(x, y);cout<<y<<end1;return 0;}运行时的输出结果是( )。A) 10B) 16C) 26D) 36A.B.C.D.

有以下程序: include using namespace std; class Point' { public: void SetPoint( 有以下程序: #include <iostream> using namespace std; class Point' { public: void SetPoint(int x,int y); void Move(int xOff,int yOff); int GetX() { return X; } int GetY() { return Y; } private: int X,Y; }; void Point::SetPoint(int x, int y) { X=x; Y=y; } void Point: :Move(int xOff, int yOff) X+=xOff; Y+=yOff; } int main () { Point p1; p1.SetPoint(1,2); p1.Move (5, 6); cout<<"Point1 is ("<<p1.GetX()<<','<<p1.GetY()<<")"<<end1; return 0; } 执行后的输出结果是( )。A.Point1 is (6,8)B.Point1 is (1,2)C.Point1 is (5,6)D.Point1 is (4,4)

有如下程序:include void fun(int x, int y){int t=x;x=y;y=t;}int main (){int 有如下程序: #include <iostream> void fun(int x, int y){int t=x;x=y;y=t;} int main () { int a[2]={23,42}; fun(a[1],a[0]); std::cout<<a[0]<<","<<a[1]<<std::endl; return 0; } 执行后的输出结果是A.42,42B.23,23C.23,42D.42,23

下列程序的输出结果是()。 include int fun(int x) {int a; if(x==0‖x==1) return 3; 下列程序的输出结果是( )。#include<stdio.h>int fun(int x){ int a;if(x==0‖x==1)return 3;elsea=x-fun(x-2) ;return a;}void main(){ printf("%d",fun(7) );}A.2B.8C.9D.5

有如下类说明: class TestClass{ int x; public: TestClass(int n){x=n;} }; class TestClass1:public TestClass{ int y; public: TestClass1(int a,int b); }; 在构造函数TestClass1的下列定义中,正确的是( )。A.TestClass1::TestClass1 (int a,int b):x(a),y(b){}B.TestClass1::TestClass1 (int a,int b):TestClass(a),y(b){}C.TestClass1::TestClass1 (int a,int b):x(a),TestClass1(b){}D.TestClass1::TestClass1 (int a,int b):TestClass(a),TestClass1(b){}

有以下程序 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

执行下列程序 int fun(int x1,int x2){ int x; x1>x2 ?(x=3):(x=4); return x+x1; } void main(){ cout<<fun(7,8); } 后输出结果是 ______。A.9B.10C.11D.12

有以下程序 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);pfintf(“%d\n”,i); } 程序运行后的输出结果是A.-4B.1C.4D.8

有下列程序: include int f(int x) { int y; if(x=0‖x==1)r 有下列程序: #include <stdio.h> int f(int x) { int y; if(x=0‖x==1)return(3); y=x*x-f(x-2); return y; } main() { int z; z=f(3);printf("%d\n",z); 程序的运行结果是( )。A.0B.9C.6D.8

有以下程序:includeusing namespace std;int f(int x);int sum(int n){ int x,s=0; f 有以下程序: #include<iostream> using namespace std; int f(int x); int sum(int n) { int x,s=0; for(x = 0;x<=n;x++) s+=f(x); return s; } int f(int x) { return (x*x+1); } int main() { int a,b; cout<<"Enter a integer number:"; cin>>a; b=sum(a) ; cout<<a<<","<<b<<end1; return 0; } 如果输入数字3,其输出结果是( )。A.3,12B.3,16C.3,18D.4,20

有以下程序: include using namespace std; int main() {int x;for(int i=1;i 有以下程序: #include <iostream> using namespace std; int main() { int x; for(int i=1;i<=100;i++) { x=i; if (++x%2==0) if (++x%3==0) if (++x%7==0) cout<A.39,81B.42,84C.26,68D.28,70

下列程序的输出结果是( )。 include int fun(int x) {int p;if(x==0‖x==1) return 3;el 下列程序的输出结果是( )。 #include<stdio.h> int fun(int x) { int p; if(x==0‖x==1) return 3; else p=x-fun(x-2); return p; } void main() { print f("\n%d", fun(5)); }A.5B.3C.7D.1

以下正确的函数定义是______。A.double f1(int x,int y)B.double f1(int x;int y)C.double f1(int x;float y)D.double f1(int x,y)

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

已知:int n=1;在下面定义引用的语句中,正确的是( )。A.int x=n;B.int x =n;C.int x;D.int x=n;

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

下列带缺省值参数的函数说明中,正确的说明是 ______。A.int Fun(int x, int y=2,int z=3);B.int Fun(int x=1,int y,int z=3);C.int Fun(int x, int y=2,iht z);D.int Fun(int x=1,int y, int z=3);

有如下程序: include using namespace std; int fun1(int x) {return++x;} int fun2(i 有如下程序:include<iostream>using namespace std;int fun1(int x) {return++x;}int fun2(int x) {return++x;}int main(){int x=1,y=2;y=fun 1(fun2(x));cout<<X<<','<<y;return 0:}程序的输出结果是______。

要使变量x赋值为1~100间(含1,不含100)的一个随机整数,正确的语句是()A、x=Int(100*RnD)B、x=Int(101*RnD)C、x=1+Int(100*RnD)D、x=1+Int(99*RnD)

单选题55. int []x= {1, 2,3,4, 5};  56. int y[] =x;  57. System.out.println(y[2]);  Which is true?()A Line 57 will print the value 2.B Line 57 will print the value 3.C Compilation will fail because of an error in line 55.D Compilation will fail because of an error in line 56.

单选题以下正确的函数原型为()Afun1(int x;int y);Bvoid fun1(x,y);Cvoid fun1(int x,y);Dvoid fun1(int,int);