intx=3;inty=1;if(x=y){System.out.println(x=+x);}Whatistheresult?() A.x=1B.x=3C.Compilationensp;fails.D.Theensp;codeensp;runsensp;withensp;noensp;output.ensp;E.Anensp;exceptionensp;isensp;thrownensp;atensp;runtime.
intx=3;inty=1;if(x=y){System.out.println(x=+x);}Whatistheresult?()
A.x=1
B.x=3
C.Compilation fails.
D.The code runs with no output. 
E.An exception is thrown at runtime.
相关考题:
以下程序运行后的输出结果是【】。 include void fun(int x,int y) {x=x+y;y=x-y 以下程序运行后的输出结果是【 】。include<iostream.h>void fun(int x,int y){ x=x+y;y=x-y;x=x-y;cout<< x << "," <<y << " ,";}void main( ){ int x=2,y=3;fun(x,y);cout<< x << "," << y << endl;}
int x=0;int y=10;do{l3.y--;++x;}while(x5);System.out.print(x+,+y);What is the result?() A.5,6B.5,5C.6,5D.6,6
intx=0;inty10;do{y--;++x;}while(x5);System.out.print(x+,+y);Whatistheresult?() A.5,6B.5,5C.6,5D.6,6
下列函数定义中,会出现编译错误的是 ______。A.max(int x,int y,int *z) { *z=x>y? x:y;}B.int max(int x,y) {int z; z=x>y? x;y; return z; }C.max(int x,int y) { int z; z=x>y? x:y; return(z); }D.int max(int x,int y) { return(x>y?x:y);}
try{intx=0;inty=5/x;}catch(Exceptione){System.out.println(Exception”);}catch(ArithmeticExceptionae){System.out.println(ArithmeticException”);}System.out.println(finished”);Whatistheresult?() A.finishedB.ExceptionC.Compilationfails.D.ArithmeticException
intx=1,y=6;while(y--){x++;}System.out.println(x=”+x+y=”+y);Whatistheresult?() A.x=6y=0B.x=7y=0C.x=6y=-1D.x=7y=-1E.Compilationfails.
下列程序执行后,屏幕的输出是()。includeusing namespace std;void swap(int x,int y) 下列程序执行后,屏幕的输出是( )。 #include<iostream> using namespace std; void swap(int x,int y) { int temp=x; x=y; y=temp; cout<<"x="<<x<<"",y=""<<y<<end1; } int main() { int x=3,y=2; swap(x,y); cout<<"x="<<x<<",y="<<y<<end1; return 0; }A.x=3,y=2 x=3,y=2B.x=2,y=3 x=3,y=2C.x=2,y=3 x=2,y=3D. x=3,y=2 x=2,y=3
下列函数定义中,会出现编译错误的是( )。A.max(int x,int y,int *z) { *z=x>y?x:y; }B.int max(int x,y) { int z; z=x>y?x:y; return z; }C.max(int x,int y) { int z; z=x>y? x:y; return(z); }D.int max(int x,int y) { return(x>y? x:y); }