有如下过程代码: Sub var_dim() static numa As Integer Dim numb As Integer numa=numa+2. nu
A.2 1
B.2 3
C.6 1
D.6 3
A.2 1
B.2 3
C.6 1
D.6 3
有如下过程代码:
Sub var_dim()
Static numa AS Integer
Dim numb As Integer
numa=Duma+2
numb=numb+1
print numa;mumb
End Sub
连续3次调用vardim过程,第3次调用时的输出是
A.2 1
B.2 3
C.6 1
D.6 3
有如下过程,将两次调用过程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
有如下自定义过程: 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 2End Sub则该段程序的执行结果是______ 。
A.12
B.23 47
C.23
D.5 10
有如下一个Sub过程: Sub mlt (ParamArray numbers()) n=1 For Each x In numbers n=n * x Next x Print n End Sub在一个事件过程中如下调用该Sub过程: Private Sub Coinmand1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a=1 b=2 c=3 d=4 mlt a,b,c,d End Sub 则运行该程序,结果为______。
A.12
B.24
C.36
D.48
A.intAver = funAver(arrA%())
B.intAver = funAver(arrA(0 to 9))
C.intAver = funAver(arrA())
D.intAver = funAver(arrA)
有如下一个Sub过程: Sub mlt(ParamArray numbers()) n=1 For Each x In numbers n=n*x Next x Print n End Sub 在一个事件过程中如下调用该Sub过程: Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a=1 b=2 c=3 d=4 mlt a,b,c,d End Sub 该程序的运行结果为()。
A.12
B.24
C.36
D.48
有如下一个函数过程: Function Fun(a As Integer) Static C b=0:b=b+1:c=c+1 Fun=a+b+c End Function 在窗体上添加一个命令按钮,事件过程如下: Private Sub Command1_Click() Dim a As Integer a=2 For i=1 To 3 Print Fun(a); Next End Sub 运行该程序,单击命令按钮,输出结果是
A.4 4 4
B.4 5 6
C.6 7 8
D.4 7 9
有如下一个函数过程:
Function Fun(a As Integer)
Static c
b=0:b=b+1:c=c+1
Fun=a+b+c
End Function
在窗体上添加一个命令按钮,事件过程如下:
Private Sub Command1_Click()
Dim a As Integer
a=2
For i=1 To 3
Print Fun(a);
Next
End Sub
运行该程序,单击命令按钮,输出结果是
A.4 4 4
B.4 5 6
C.6 7 8
D.4 7 9
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!