哪个是如下代码的输出结果:(). 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
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
举一反三
- 下面程序的运行结果是(<br/>)。 int fun (int x,int y) { x=x+y; return(x);}int main( ) { int x=2,y=4; y=fun (x,y); printf("x=%d y=%d\n", x, y);} A: x=2<br/>y=4 B: x=2<br/>y=6 C: x=6<br/>y=6 D: x=6<br/>y=4
- 已有定义语句:int x=6,y=4,z=5;,执行以下语句后,能正确表示x,y,z值的选项是( )。if(x<;y) z=x;x=y;y=z; A: x=4,y=5,z=6 B: x=6,y=4,z=5 C: x=4,y=5,z=5 D: x=5,y=6,z=4
- 若x=6 ,y=5 则表达式int max=x>y?x:y 的结果为()
- 已有定义语句:int x=6,y=4,z=5;,执行以下语句if(x A: x=4,y=5,z=6 B: x=5,y=6,z=4 C: x=4,y=6,z=6 D: x=4,y=5,z=5
- 下面程序段的运行结果为( ) 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