执行下面for循环的输出结果是for(int x = 0; x <;=10; ){System.out.println("X=" + x);}
A: "X=0","X=1"…"X=10"
B: 输出无限个"X=0"
C: 代码不能编译
D: 代码不能运行
A: "X=0","X=1"…"X=10"
B: 输出无限个"X=0"
C: 代码不能编译
D: 代码不能运行
举一反三
- 在Java中,下列代码的运行结果是()int x = 10;int y = 20;if(x=y){ System.out.println(x);}else{ System.out.println(y)} A: 输出10 B: 输出20 C: 输出3 D: 编译报错
- 下面代码的输出结果是哪个选项?x = 0 if x < 4: x = x + 1 print("x is", x) A: x is 0 B: x is 1 C: x is 2 D: x is 3 E: x is 4
- 下列代码的输出结果是___________________ for(int y=0; y<4; y++){ for(int x=0; x<5; x++){ System.out.print("*"); } System.out.println(); }
- 下面代码,输出结果是?int x=-3;int y=-10;System.out.println(y%x); A: -1 B: 1 C: 2 D: -2
- 下列代码输出的结果是__________x = 0 while x < 4: x = x + 1print("x is", x) A: x is 0 B: 分别输出x is 1 x is 2 x is 3 x is 4 C: x is 3 D: x is 4