阅读程序 SUB P(B( ) AS INTEGER) FOR I=1 TO 4 B(I) =2*I NEXT I END SUB PRIVATE SUB COMMAND1_CLICK( ) DIM A( 1 TO 4) AS INTEGER A(1)=5 A(2) =6 A(3) =7 A(4) =8 P A( ) FOR I = 1 TO 4 MSGBOX A(I) NEXT I END SUB 运行上面的程序,单击命令按钮COMMAND1后,消息框4次输出的内容分别是( )。
A.出错
B.10, 12, 14, 16
C.5, 6, 7, 8
D.2, 4, 6, 8
第1题:
( 26 )有以下程序:
Sub subP(b() As Integer)
For i = 1 To 4
b(i) = 2 * i
Next i
End Sub
Private Sub Command1_Click()
Dim a(1 To 4) As Integer
a(1) = 5
a(2) = 6
a(3) = 7
a(4) = 8
subP a()
For i = 1 To 4
Print a(i)
Next i
End Sub
运行上面的程序,单击命令按钮,输出结果为
A ) 2
4
6
8
B ) 5
6
7
8
C ) 10
12
14
16
D ) 出错
第2题:
有如下程序:
Private Sub Command1_Click()
Dim k As Integer, m As Integer
Dim p As Integer
k=4: m=1
p=PC(k, m) : Print p;
p=PC(k, m) : Print p
End Sub
Private Function PC(a As Integer, b As Integer)
Static m As Integer, i As Integer
m=0: i=2
i=i + m + 1
m=i + a + b
PC=m
End Function
程序运行后,输出的结果为( )。
A.4 6
B.6 6
C.8 8
D.10 12
第3题:
有以下程序:
Sub subp(b()As Integer)
For i=1To4
b(i)=2-i
Next i
End Sub
Private Sub Command1_Click()
Dim a (1 To 4)As Integer
A) (1)=5
A) (2)=6
A) (3)=7
A) (4)=8
subpa()
For i=1 To4
Print a (i)
Next i
End Sub
运行上面的程序,单击命令按钮,输出结果为( )。 A.2 4 6 8
B.5 6 7 8
C.10 12 14 16
D.出错
第4题:
下面程序段的运行结果是【 】。
Option Base 1
Private Sub Swap (a() As Integ
For I=1 to 10\2
t=a(I)
a(I)=a(10-I+1)
a(10-I+1)=t
Next I
End Sub
Private Sub Form_Click()
Dim x(10) As Integer
For I=1 to 10
x(I)=I*2
Next I
Swap x()
For I=1 to 10
Print x(I)
Next I
End Sub
第5题:
阅读程序: Sub p( b () As Integer)For i =1To 4 b(i) = 2(iNext i End Sub Private Sub Command1_Click()Dim a (1 To 4) As Integer a(1)=5 a(2)=6 a(3)=7 a(4)=8 call p (a) For i=1 To 4 Print a(i) Next iEnd Sub运行上面的程序,单击命令按钮,输出结果为。
第6题:
在窗体上画一个命令按钮,然后编写如下事件过程:
Sub BTC(oldCopy() As Integer, newCopy() As Integer)
Dim i As Integer
For i=LBound(oldCopy() ) To UBound(oldCopy() )
newCopy(i) =oldCopy(i)
Next i
End Sub
Private Sub Command1_Click()
Dim m(10) As Integer, n(10) As Integer
For i=1 To 10
m(i) =i i
Next i
Call BTC(m, n)
Print n(5)
End Sub
程序运行后,单击命令按钮输出结果为( )。
A.0
B.2
C.10
D.25
第7题:
请阅读程序:
Sub subP(b()As Integer)
For i=1 To 4
b(i)=2*i
Next i
End Sub
Private Sub Command 1_Click()
Dim a(1 To 4)As Integer
a(1)=5:a(2)=6:a(3)=7:a(4)=8
subP a()
For i=1 To 4
Print a(i)
Next i
End Sub
运行上面的程序,单击命令按钮,则输出结果是( )。
A.2 4 6 8
B.5 6 7 8
C.10 12 14 16
D.出错
第8题:
在窗体上添加一个名称为Command1的命令按钮,然后编写如下程序:
Private Sub f(ByVa1 x As Integer)
x=x+4
End Sub
Private Sub Command1_Click()
i=3
Call f(1)
If i>4 Then i=i*2
MsgBox i
End Sub
打开窗体运行后,单击命令按钮,则消息框的输出结果为______。
第9题:
有如下的程序:
Private Sub Command1_Click()
Dim k As Integer,m AB Integer
Dim P As Integer
k=4:m=1
P=Fun(k,m) =Print P;
P=Fun(k,m) :Print P
End Sub
Private Function Fun(a As Integer,b As Integer)
Static m As Integer,i As Integer
m=5:i=2
i=i+m+1
m=i+a+b
Fun=m\2
End Function
单击命令按钮后,输出结果为
A. 2 2
B.4 4
C.5 5
D.6 6
第10题:
在窗体中添加一个名称为Com1的命令按钮,然后编写如下程序:
Private Sub s(ByVal p As Integer)
p=p*2
End Sub
Private Sub Com1_Click()
Dim i As Integer
i=3
Call s(i)
If i>4 Then i=i^2
End sub
窗体打开运行后,单击命令按钮,则消息框的输出结果为( )。