publicclassWhileFoo{publicstaticvoidmain(Stringargs){intx=1,y=6;while(y--){x--;}system.out.printIn(x=”+xy=”+y);}}Whatistheresult?() A.Theoutputisx=6y=0B.Theoutputisx=7y=0C.Theoutputisx=6y=-1D.Theoutputisx=7y=-1E.Compilationwillfail.

publicclassWhileFoo{publicstaticvoidmain(Stringargs){intx=1,y=6;while(y--){x--;}system.out.printIn(x=”+xy=”+y);}}Whatistheresult?()

A.Theoutputisx=6y=0

B.Theoutputisx=7y=0

C.Theoutputisx=6y=-1

D.Theoutputisx=7y=-1

E.Compilationwillfail.


相关考题:

intx=0;inty10;do{y--;++x;}while(x5);System.out.print(x+,+y);Whatistheresult?() A.5,6B.5,5C.6,5D.6,6

publicclassWhileFoo{publicstaticvoidmain(String[]args){intx=1,y=6;while(y--){x--;}system.out.printIn(x=”+xy=”+y);}}Whatistheresult?() A.Theoutputisx=6y=0B.Theoutputisx=7y=0C.Theoutputisx=6y=-1D.Theoutputisx=7y=-1E.Compilationwillfail.

publicclassIfTest(publicstaticvoidmain(string[]args){intx=3;inty=1;if(x=y)system.out.printIn(Notequal”);elsesystem.out.printIn(Equal”);})Whatistheresult?() A.Theoutputis“Equal”B.Theoutputin“NotEqual”C.Anerroratline5causescompilationtofall.D.Theprogramexecutesbutdoesnotprintamessage.

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.

publicclassIfTest(publicstaticvoidmain(stringargs){intx=3;inty=1;if(x=y)system.out.printIn(Notequal”);elsesystem.out.printIn(Equal”);})Whatistheresult?() A.Theoutputis“Equal”B.Theoutputin“NotEqual”C.Anerroratline5causescompilationtofall.D.Theprogramexecutesbutdoesnotprintamessage.

以下程序的输出结果为:public class test {public static void main(String args[]) {int x=1,y=1,z=1;if (x--==1}} A. x=0,y=2,z=1B. x=1,y=2,z=1C. x=0,y=1,z=1D. x=0,y=2,z=2

下列程序的输出结果中 x= [填空1] ? public class E { public static void main (String []args) { int x = 1,y = 6; while (y-->0) { x--;} System.out.print("x="+x); }}

28、下列程序输出结果是什么? public class E { public static void main(String[] args) { int x=1,y=6; while(y-->0) { x--; } System.out.print("x="+x+",y="+y); } }

下列程序输出结果是什么? public class E { public static void main(String[] args) { int x=1,y=6; while(y-->0) { x--; } System.out.print("x="+x+",y="+y); } }