• 2022-06-08
    请阅读下面的程序 public class Example { public static void main(String[] args) { int x = 1; do { x++; } while (x <= 4); System.out.println("x = " + x); } } 运行程序后,下列选项中,哪一个是x的值()
    A: 3
    B: 4
    C: 5
    D: 6
  • C

    内容

    • 0

      请阅读下面的程序 public class Example03 { public static void main(String args) { int x = 3; if (x > 5) { System.out.println("a"); } else { System.out.println("b"); } } } 程序的运行结果是()

    • 1

      请阅读下面的程序 public class Test { public static void main(String[] args) { for(int x = 0 ; x <=3 ; x++){ continue; System.out.print(x%2+” “); } } } 下列选项中,哪一个是程序的运行结果

    • 2

      阅读下面的程序 public class Test { public static void main(String&#91;&#93; args) { for(int x = 0 ; x <=3 ; x++){ continue; System.out.print(x%2); } } }

    • 3

      请阅读下面的程序 public class Test { public static void main(String[] args) { int x; int y; for (x = 1, y = 1; x <= 100; x++) { if (y >= 20) { break; } if (y % 3 == 1) { y += 3; continue; } y -= 5; } System.out.println(“x=” + x + “,y=” + y); } } 下列选项中,哪一个是程序的运行结果( )

    • 4

      请阅读下面的程序 public class Example03 { public static void main(String args) { int x = 3; if (x >; 5) { System.out.println("a"); } else { System.out.println("b"); } }} 程序的运行结果是() A: true B: false C: a D: b