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.

publicclassWhileFoo{publicstaticvoidmain(String[]args){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.


相关考题:

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.

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.

执行如下语句之后,输出的结果是______。 public class ex24 { public static void main(String[] args) { int x=5,y=3; x+=X-- *--y; System.out.println{x); } }A.0B.1C.trueD.false

执行如下语句之后,输出的结果是 ( )public class ex1{ public static void main(String[]args){ int x=5,y=3, x+=x--*--y System.out.println(x); }}A.12B.8C.15D.16

下列程序的输出结果中 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); }}

写出下面程序的运行结果,了解do-while语句的使用。 public class cs5 { public static void main(String[] args) { int x = 23; do{ System.out.print(x--); }while(x>20); } }

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); } }