下面程序段的运行结果为( ) int x=5,y=10; if(x==y) System.out.println(x); else System.out.println(y);
A: x==y
B: 5
C: 10
D: x!=y
A: x==y
B: 5
C: 10
D: x!=y
C
本题目来自[网课答案]本页地址:https://www.wkda.cn/ask/zjzjzypzoxezzzo.html
举一反三
- 下面程序段的运行结果为( ) int x=5,y=10; if(x) System.out.println(x); else System.out.println(y); A: 5 B: 程序出错 C: 10 D: 11
- 下列程序段运行后的结果是()int x = 1;int y = 2;x += y + y;if (x < 5 && y <= 4) {System.out.println("1");} else if (x >= 5 || y > 4) {System.out.println("2");} else {System.out.println("error");} A: 无法编译 B: 程序报错 C: 1 D: 2
- 以下程序段的输出结果为 【14】 。int x=0,y=4,z=5;if(x>2)if(y<5)System. out. println("Message one");elseSystem. out . println("Message two");else if(z>5)System. out. println("Message three");elseSystem. out. println("Message four");
- 在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: 编译报错
- 以下程序段的输出结果是_________。 int x = 5, y = 6, z = 4; if (x + y > z && x + z > y && z + y > x) System.out.println("三角形"); else System.out.println("不是三角形");
内容
- 0
下面程序段执行结果为( )。 x = 5 : y = -6 If not x > 0 Then x = y – 3 Else y = x + 3 End If Print x - y; y - x
- 1
哪个是如下代码的输出结果:(). double x = 5.5; int y = (int)x; System.out.println("x is " + x + " and y is " + y); A: x is 5 and y is 6 B: x is 6.0 and y is 6.0 C: x is 6 and y is 6 D: x is 5.5 and y is 5
- 2
设x=2以及y=3,下面代码的输出结果是。if (x >; 2)if(y >; 2){int z = x + y;System.out.println("z is " + z) ;}else{System.out.println("x is " + x) ;} A: x is 2 B: z is 5 C: x is 5 D: 无输出
- 3
以下代码段执行后的输出结果为: int x=3; int y =10 ; System.out.println(y%x);
- 4
请写出下列程序的运行结果: int x=5,y,z; [br][/br] y=++x; [br][/br] z=x++; [br][/br] System.out.println(x); [br][/br] System.out.println(y); [br][/br] System.out.println(z);