更多"有如下程序,可以得到0到100之间所有偶数之和。 DIM I"的相关试题:
[单项选择]有如下程序,可以得到0到100之间所有偶数之和。 DIM I AS INTEGER DIM SUM AS INTEGER SUM = 0 FOR I =0 TO 100 STEP 2 SUM = SUM + I NEXT I DEBUG. PRINT I DEBUG. PRINT SUM 程序运行后,变量I和SUM的值是( )。
A. 100和2450
B. 102和2550
C. 104和2650
D. 106和2850
[填空题]已知如下程序段:
Dim MyInt As Integer
Dim MyLen
MyLen=Len(MyInt)
执行以上程序段后,MyLen为______。
[填空题]下面程序段运行后,变量X的值为 【14】 。
Dim X As Integer
Dim I as Integer
X = 0
For i = 0 to 50 step 10
X=X+i
Print X
[单项选择]有数据定义语句:Dim a,b As Integer Dim x%,y as Integer执行语句后,不是整型变量的是
A. .a
B. .b
C. .x
D. .y
[单项选择]下列程序段的执行结果为 ______。
Dim m(3,3)As Integer
Dim i As Integer
Dim j As Integer
Dim x As Integer
For i=1 To 3
m(i,i)=i
Next
For i=0 To 3
For j=0 To 3
x=x+m(i,j)
Next
Next
Print x
A. 3
B. 4
C. 5
D. 6
[单项选择]下列程序段的执行结果为______。
Dim m(3,3)As Integer
Dim i As Integer
Dim j As Integer
Dim x As Integer
For i=1 To 3
m(i,i)=i
Next
For i=0 T0 3
For j=0 To 3
x=x+m(i, j)
Next
Next
Print x
A. 3
B. 4
C. 5
D. 6
[单项选择]有如下程序:
Option Base 1
Dim arr( ) As Integer
Private Sub Form_Click( )
Dim i As Integer, j As Integer
ReDim arr(3,2)
For i=1 To 3
for j=1 To 2
arr(i,j)=i*2+j
Next j
Next i
ReDim Preserve arr(3,4)
For j=3 To 4
arr(3,j)=j+9
Next j
Print arr(3,2); arr(3,4)
End Sub
程序运行后,单击窗体,输出结果为
A. 8 13
B. 0 13
C. 7 12
D. 0 0
[单项选择]设有如下程序: Dim a( )As Integer Private Sub Command1_Click( ) n=-5:m=6 ReDim a(n To m) For i=LBound(a,1)To UBound(a,1) a(i)=i Next i Print a(LBound(a,1));a(UBound(a,1)) End Sub 程序运行后,单击命令按钮,则输出结果是 ______。
A. 0 0
B. -5 0
C. -5 6
D. 0 6
[单项选择]假定有如下的程序段:Dim intVarAs Integer intvar=True Print intVar则输出结果是
A. 0
B. -1
C. True
D. False
[单项选择]23 有如下程序段,该程序段循环的次数是______。 Dim i As Integer Dim j As Integer Dim k As Integer k=0 For i = 0 To 10 Step 3 For j = 1 To 5 If j > 3 Then k = k + 4: Exit For k=k+1 Print k Next j If i > 8 Then Exit For Next i
A. 9
B. 10
C. 11
D. 12
[填空题]在窗体上画’一个命令按钮,然后编写如下程序
Dim x As Integer
Sub inc (a As Integer)
x=x +a
End Sub
Private Sub Command l_click( )
inc 2
inc 3
inc4
Ms g box x;
End Sub
程序执行后,单击Command I命令按钮,消息框显示结果是 【14】 。
[填空题]在窗体上画一个命令按钮,然后编写如下程序:
Dim x As Integer
Sub inc(a As Integer)
x=x+a
End Sub
Private SubCommand1_Click( )
inc 2
inc 3
inc 4
Msgbox x;
End Sub
程序执行后,单击Command1命令按钮,消息框显示结果是 【14】 。