若x为int型变量,则执行x=7;x+=x-=x+x;后的x值为()
第1题:
设x为int型变量,执行以下语句,x=10;x+=x-=x-x;x的值为______。
A.10
B.20
C.30
D.40
第2题:
设x是值为10的int型变量,则在计算表达式x+=x-=x-x后,x的值为 ______。
A.1
B.20
C.40
D.30
第3题:
若有定义语句: int x=10; ,则表达式 x-=x+x 的值为
A)-20
B)-10
C)0
D)10
第4题:
若有定义语句:“int x=10;”,则表达式x-=x+x的值为( )。
A.-20
B.-l0
C.0
D.10
第5题:
设x为int型变量,执行以下语句,x=10;x+=x-x;x;x的值为 ______。
A.10
B.20
C.30
D.40
第6题:
设x和y均为int型变量,则执行下面的循环后,y值为( )。 public class Sun { public static void main(String args[ ]) { int x, y; for (y=1, x=1; y<=50; y++) { if(x>=10) break; if (x%2==1) { x+=5; continue; } x-=3; } System.out.println (y); } }
A.2
B.4
C.6
D.8
第7题:
设X为int型变量,则执行以下语句后,x的值为( )。 x=10:x=x-=x——x:
A.10
B.20
C.40
D.30
第8题:
若x为int型变量,则执行以下语句后,x的值为 ( ) x=6; x+=x-=x*x;
A.36
B.-60
C.60
D.-24
第9题:
若有定义语句:int X=10;,则表达式x-=x+x的值为( )。
A.0
B.-20
C.-10
D.10
第10题:
设x和y均为int型变量,则执行下面的循环后,y值为( )。#include <iostream.h>void main(){int x, y;for(y= 1,x= 1 ;y<=50;y++){ if(x>=10) }break;if (x%2==1){ x+=5; continue;} x-=3;} cout<<y;
A.2
B.4
C.6
D.8