下列程序打印结果为 ______。Private Sub Command1_ Click() Dim a(5)As String Dim b As Integer Dim i As Integer for i = 0 To 5 a(i)= i +1 Print a(i); Next iEnd Sub
A.12345
B.6
C.1 2 3 4 5 6
D.0
第1题:
下列程序的输出结果是【 】
Private Sub Command1_Click()
Dim a(1 To 20)
Dim i
For i=l To 20
a(i)=i
Next i
For Each i In a()
a (i) =20
Next i
第2题:
设有如下程序:
Private Sub Form. Click( )
Dim ary(1 To 5)As Integer
Dim i As Integer
Dim sum As Integer
For i=1 To 5
ary(i)=i+l
sum=sum+ary(i)
Next i
Print sum
End Sub
程序运行后,单击窗体,则在窗体上显示的是( )。
A.15
B.16
C.20
D.25
第3题:
下列程序的输出结果为( )。 Private Sub Command1_Click() Dim a(20) For j=1 To 20 Step2 a(j)=j Next i Print a(1)+a(2)+a(3) End Sub
A.4
B.5
C.6
D.7
第4题:
下列程序的执行结果为______。Private sub Command1_ Click ( ) a = 100 b = 50 if a <> b then a = a + b Else b = b -a Print a, bEnd Sub
A.50 50
B.150 50
C.200 200
D.10 10
第5题:
下列程序段的运行结果是:Private Sub Command1_Click() Dim n AS Integer I =21: n = 3 do while I>n I=I- n Loop Print IEnd Sub在窗体上打印的结果是______。
A.3
B.5
C.6
D.8
第6题:
有如下过程,将两次调用过程proc的结果分别填于空【 】和【 】处。
Private Sub Command1_Click( )
Dim a As Integer
Dim b As Integer
a=2
b=5
Call proc(a,B) 【 】
Call proc(A) 【 】
End Sub
Private Sub proc(x As Integer,Optional y)
Dim z As Integer
If IsMissing(y) Then
MsgBox ("没有提供可选参数")
Else
z=x*y
MsgBox ("乘积=" + Str(z))
End If
End Sub
第7题:
下列程序的输出结果是【 】。
Private Sub Command1_Click()
Dim a(1 To 20)
Dim i
For i=1 To 20
a(i)=i
Next i
For Each i In a()
a(i)=20
Next i
Print a(2)
End Sub
第8题:
单击一次命令按钮之后,窗体中的输出结果为______。 Private Sub Command1_ Click() Dim a As Single Dim b As Single a = 10 b = 20 Call Num(a,B)Print a, b End Sub Sub Num(a,B)t = a a = b / t b = t End Sub
A.20 10
B.10 20
C.2 10
D.10 10
第9题:
使用窗体的Click事件在窗体输出1~1000之间能同时被5和7整除的整数,如图所示,

请填空
Private Sub Form_Click()
Dim i As Integer
Dim Sum As Integer
Cls
For i=1 To 1000
If 【 】 Then
Sum=Sum+i
Printi
End If
Next i
Print"Sum="&Sum
End Sub
第10题:
Private Sub Commandl Click()
Dim i As Integer, j As Integer
Dim a (10,10)As Integer
For i=1 To 3
For j= i To 3
a(i,j)=(i-1)*3+j
Print a (i,j);
Next j
Next i
End Sub
程序运行后,单击命令按钮,窗体上显示的是( )。


第11题:
下列程序的输出结果是( )。
Private Sub Command1_Click()
Dim arr(1 To 10)
For i=1 To 10
Next i
For Each i In arr()
Next i
End Sub
第12题:
下列程序的执行结果为 Private Sub Commandl_Click() Dim s1 As String ,s2 As String s1= "abcd" Call Transfer(sl,s2) Print s2 End Sub Private Sub Transfer (ByVal xstr As String,ystr As String) Dim tempstr As String ystr=tempstr End Sub
A.dcba
B.abdc
C.abcd
D.dabc
第13题:
下列程序输出的结果为【 】。
Private Sub Commandl_Click( )
Dim a As Boolean
a = True
If a Then GoTo 11 Else GoTo 22
11:
Print "VB";
22:
Print "VC"
End Sub
第14题:
下面程序的输出结果是【 】。
Private Sub Commandl_Click( )
Dim a(1 To 20)
Dim i
Fori = 1 To 20
a(i) = i
Next i
For Each i In a( )
a(i) = 20
Next i
Print a(2)
End Sub
第15题:
下列程序的运行机结果是【 】。
Private Sub Form_ Click()
Dim k As Integer
n= 5
m= 1
k= 1
Do
m=m+2
k= k+1
Loop While k<=n
Print m
End Sub
第16题:
有如下事件过程:
Private Sub Form. Active ( )
Dim Score (1 to 3) As Integer
Dim i As Integer
Dim t As Variant
Fori=3 To 1 step-1
Score (i) = 2 * i
Next
For Each t In Score
Print t
Next
End Sub
程序运行后窗体上显示的值为【 】。
第17题:
下列程序的运行结果为______。Private Sub Command1_ Click() Dim s As Long Dim x As Integer s = 0 for x = 99 To 1 step - 2 s=s+ x Next x Print sEnd Sub
A.100
B.500
C.2500
D.5000
第18题:
下列程序的输出结果是【 】。
Private Sub Command l Click()
Dim a(1 TO 20)
Dim i
For i=1 TO 20
a(i)=i
Next i
For Each i In a()
a(i)=20
Next i
Print a(2) End Sub
第19题:
有如下函数过程。
Function UNC(ByVal x As Integer,ByVal y As Integer)As Integer
Do While y<>0
S=x/y
x=y
y=S
Loop
UNC=x
End Function
以下事件调用该函数,程序运行结果是【 】。
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
a=12
b=2
x=UNC(a,b)
Print x
End Sub
第20题:
有过程如下:Sub fact (m As Integer, total As Long) Dim i As Integer total = 1 for i = 1 To m total = total*i Next iEnd Sub调用它的事件过程如下:Private Sub Command1_ Click () Dim tot As Long Dim a As Integer a = Val InputBox (“请输入数据”)) Call fact (a, tot) Print totEnd Sub则输入数据5,运行结果为 ______。
A.100
B.120
C.200
D.50
第21题:
单击窗体时,下列程序代码的执行结果为______ 。 Private Sub Test (x As Integer) x=x*2+1 If x < 6 Then Call Test(x) End If x-x*2+1 Print x; End Sub Private Sub Command1_ Click () Test 2 End Sub
A.23 47
B.5 11
C.10 22
D.23 29
第22题:
假定有如下的Sub过程:Sub Sub1 (x As Single, y As Single) t=x x = t/y y = t Mod yEnd Sub 在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_ Click() Dim a As Single Dim b As Single a = 5 b = 4 Sub1 a, b Print a; b End Sub 程序运行后,单击命令按钮,输出结果为______。
A.5 4
B.1 1
C.1.2 5.4
D.1.25 1
第23题:
已知两个窗体Form1、Form2,下列事件过程中,______可以实现单击窗体Form1的命令按钮时,显示窗体Form2,而窗体Form1消失。
A.Private Sub Command1_ Click() LoadForm2 Form1. Hide End Sub
B.Private Sub Command1_ Click() Show Form2 Form1. Hide EndSub
C.Private Sub Command1_ click() Show Form2 Form1. Hide End Sub
D.Private Sub Command1_ click()