更多"关于以下程序段的执行结果,说法正确的是( )。 public cla"的相关试题:
[填空题]下列程序段欲重复执行LOOP开始的程序段50次。
MOV A, #32H
LOOP: ……
DEC A
DJNZ ACC,LOOP
错误:______
改正:______
[单项选择]有如下程序段,该程序段执行完后,共执行循环的次数是 Private Sub Command1_Click( ) Tota1=0 Counter=1 Do Print Counter Tota1=tota1+Counter Print total Counter=Counter+1 If total>=10 Then Exit Do End lf Loop While Counter<=10 End Sub
[单项选择]执行下面程序段,屏幕上将输出( )。
public class Test
private int x=10,y=20;
public Test (int x,int y)
System.out.println (x+this.x);
System.out.println (y+y);
public static void main (String[] args)
Testt= new Test(30,50);
A. 无输出
B. 20
C. 40
D. 40
[单项选择]有如下的程序段,该程序段的执行完后,共执行循环的次数是 Private Sub Command1_Click( ) total=0 Counter=l Do Print Counter total=total+Counter Print total Counter=Counter+1 If total>=10 Then Exit Do End If Loop While Counter<=10 End Sub
A. 5
B. 10
C. 12
D. 20
[单项选择]下列程序段执行后,变量c的值为( )。
public class Test
public static void main(String[ ] args)
float a=10, b=9, c=8;
if (--a==B) c= --a/c;
System. out. println (c) ;
A. 1.125
B. 1.0
C. 1.25
D. 0.0
[单项选择]执行下列程序段之后,变量n的值为( )。
public class Test
public static void main(String[ ] args)
int y = 2;
int z = 3;
int n = 4;
n=n+-y* z/n;
System. out. println(n);
A. 3
B. -1
C. -12
D. -3
[填空题]执行下面的程序段,输出结果为 【7】 。
public class Q public Static Void main(String args[])
int anar[]=new int[5];
System.out.println(anar[0]);
[单项选择]执行下面程序段,屏幕上将输出( )。 public class Test { private int x=10,y=20; public Test (int x,int y) { System.out.println (x+this.x); System.out.println (y+y); } public static void main (String[] args) { Testt= new Test(30,50); } }
A. 无输出
B. 20 40
C. 40 100
D. 40 70
[填空题]执行下面的程序段,输出结果为 【8】 。
public class Q
{
public static void main(String argv[])
{
int anar[]=new int[5];
System. out.println(anar[0]);
}
}
[单项选择]下列程序段执行后,x5的结果是______。 public class ex42 { public static void main(String[] args) { int xl = 8; int x2 = 12; int x3=7; int x4; int x5; x4 = x1 > x2 x1 : x2+ x1; x5 = x4 > x3 x4 : x3; System.out.println(x5); } }
A. 11
B. 20
C. 10
D. 12
[单项选择]执行下列程序段之后,输出的结果是( )。
public class Test
public static void main(String[ ] args)
byte a = 2;
short b = 3;
long c = 4;
c=a%b*4%b;
System. out. println(c) ;
A. 2
B. 1
C. -1
D. -2
[填空题]执行下列程序段后输出的结果是 【10】 。
public class Test
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);
[填空题]执行下面的程序段,输出结果为 【8】
public class Q
{
public static void main(String argv[]
{
int anar[]=new int [5];
System.out.println(anar[0];
}
}
[填空题]分析下面程序段,试回答:
(1)该程序段是什么结构的程序;
(2)该程序段执行后,(DL)=______,屏幕上显示的字符是______。
Buffer DB 0CH
┇
MOV AL,Buffer
CALLFAR PTR SUBROUT
┇
SUBROUT PROC FAR
CM PAL, 10
JC K1
ADD AL,7
K1: ADD AL,30H
MOV DL,AL
MOV AH,2
INT 21H
RET
SUBROUT ENDP
[单项选择]执行下面程序段的输出结果为______。
public class Q
public static void main(String argv[])
int anar[]=new int[5];
System. out. println(anar[O]);
A. 0
B. 1
C. 2
D. 5
[填空题]执行下列程序段后输出的结果是______。
public class Test
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-=2;
System.out.println(y);