题目内容

假设x=1,y=-1,z=1。以下语句的输出是_________?(请先正确缩进语句。) if (x > 0) if (y > 0) System.out.println("x > 0 and y > 0"); else if (z > 0) System.out.println("x < 0 and z > 0");

A. x > 0 and y > 0;
B. x < 0 and z > 0;
C. x < 0 and z < 0;
D. no output.

查看答案
更多问题

以下代码的输出是什么? int x = 0; while (x < 4) { x = x + 1; } System.out.println("x is " + x);

A. x is 0
B. x is 1
C. x is 3
D. x is 4

以下代码的输出结果是_________? int number = 6; while (number > 0) { number -= 3; System.out.print(number + " "); }

A. 60
B. 63
C. 30
D. 3 0 -3

执行以下循环后,count的值是_________? int count = 0; do { System.out.println("Welcome to Java"); } while (count++ < 9); System.out.println(count);

A. 8
B. 9
C. 10
D. 11

执行下面的语句后,a、b、c的值分别是()() ()int a = 2 ;int b = (a++) * 3 ;int c = (++a) * 3 ;

答案查题题库