有如下事件过程:
Private Sub Command1_Click()
Dim m As Integer, n As Integer
m=2: n=1
Print "m="; m; "n="; n
Call TOD(m, n)
Print "m="; m; "n="; n
End Sub
Sub TOD(x, y)
x=x ^ 2
y=y ^ 3
End Sub
程序运行后,输出的结果为( )。
A.m=2,n=1
m=1,n=2
B.m=2,n=1
m=4,n=1
C.m=1,n=2
m=1,n=4
D.m=1,n=2
m=2,n=4
第1题:
在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Commandl_Click() Dim m As Integer, n As Integer, p As Integer m=3: n=5: p=0 Call Y(m, n, p) Print Str(p) End Sub Sub Y(ByVal i As Integer, ByVal j As Integer, k As Integer) k=i+j End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )
A.4
B.6
C.8
D.10
第2题:
单击命令按钮后,下列程序代码的执行结果是______。
Public Sub fun (a As Integer, b As Integer, c As Integer)
Do
a=b+ c
n=n+1
Loop While n > 3
End Sub
Private Sub command1_ click()
Dim m As Integer, n As Integer, i As Integer
For i = 0 To 2: m = n + 1: Next i
For i = 1 To 2: Call fun (m, n, i): Next i
For i = 0 To 3
Print m;
Next i
End Sub
第3题:
(6)在窗体上有1个名称为Command 1的命令按钮,并有如下事件过程和函数过程:
Private Sub Command 1_Click()
Dim p As Integer
p=m(1)+m(2)+m(3)
Print p
End Sub
Private Function m(n As Integer) As Integer
Static s As Integer
For k=1 To n
s=s+1
Next
m=s
End Function
运行程序,单击命令按钮Command 1的输出结果为【6】。
第4题:
在窗体上画一个命令按钮,然后编写如下事件过程。 Private Sub Command1_Click( ) Dim m As Integer, n As Integer, p As Integer m=3: n=5:p=0 Call Y(m, n, p) Print Str(p) End Sub Sub Y(ByVal i As Integer, ByVal j As Integer, k As Integer) k=i+j End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是
A.4
B.6
C.8
D.10
第5题:
在窗体上画一个命令按钮,然后编写如下事件过程。
Private Sub Command1_Click()
Dim m As Integer, n As Integer, p As Integer
m=3: n=5: p=0
Call Y(m, n, p)
Print Str(p)
End Sub
Sub Y(ByVal i As Integer, ByVal j As Integer, k As Integer)
k=i + j
End Sub
程序运行后,如果单击命令按钮,则在窗体上显示的内容是
A.4
B.6
C.8
D.10