更多“classWhileTests{publicstaticvoidmain(String[]args){intx=5;while(++x〈3){--x;}System.out.println("x="+x);}}结果是什么?() ”相关问题
  • 第1题:

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

    A.0

    B.1

    C.true

    D.false


    正确答案:C

  • 第2题:

    【分录题】写出以下程序运行结果。 public class Demo7 { public static void main(String[] args) { int i=1,j=0; int x=2; while(x<13) { for(;;) { if(i*j>10) break; i++; j++; } x=x+2; } System.out.println(x); System.out.println(i); System.out.println(j); } }


    B 本题考查带参数的宏的定义:“#defineADD(x)x+x”中x代表m+n,故s写成s=m+n+m+n*k=1+2+1+2*3=10。

  • 第3题:

    下列程序输出结果是什么? 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); } }


    C

  • 第4题:

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


    C

  • 第5题:

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


    8