Sub Sub1(m As Integer,total As Long)
D.im i As Integer
total=1
F.or i=1 To m
total=total*i
Next
E.nd Sub
调用它的事件过程如下:
Private Sub Command1_Click()
D.im tot As Long,a As Integer
a=Val(InputBox("请输入数据"))
C.all Sub1(a,tot)
Print tot
E.nd Sub
则输入数据5,运行结果为[ ]。
[单选题]有过程如下: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
[单选题]编写如下事件过程: Private sub sub1 (ByVal x1 As String, y1 As String) Dim xt As String Dim i As Integer i = Len(x1) Do While i>= 1 xt = xt + Mid(x1, i, 1) i=i-1 Loop y1 = xt End Sub Private Sub Form. Click() Dim s1 As String, s2 As String s1= "teacher" sub
[单选题]假定有如下的Sub过程:Sub Sub1(x As Single, y As single)t=xx=t / yy=t Mod yE.nd Sub在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_Click()D.im a As SingleD.im b As Singlea=5b=4Sub1 a,bPrint a;bE.nd Sub程序运行后,单击命令按钮,输出结果为A.54B.] 1]]1C.] 1.2]]5.4D.] 1.
[单选题]假定有如下的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 4B.1 1C.1.2 5.4D
[单选题]假定有如下的Sub过程:Sub Sub1(x As Single,y As single)t=xx=t/yy=t Mod yE.nd Sub在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_click()D.im a As SingleD.im b As Singlea=5b=4Sub1 a,bPrint a;bE.nd Sub程序运行后,单击命令按钮,输出结果为A.B.C.D.
[单选题]有程序如下: 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 8B.5 2 2 2C.10 1
[单选题]在窗体中添加一个命令按钮,编写如下程序:Private Sub Sub1(p,m,n)p=p+1:m=m+1:n=n+1Print "sub1:";p;m;nE.nd SubPrivate Sub Command1_Click()a1=1:b=2:c1=3C.all Sub1(a,b1+3,c1)Print"Main:";a1;b1;c1E.nd Sub程序运行后,输出结果为A.Sub: 2 6 4 Main: 2 6 4B.Sub: 2 6 4 Main: 2 6 4C.Sub: 2
[单选题]设有如下通用过程: Public Sub Fun(a() As Integer, x As Integer) For i=1 To 5 x=x+a(i) Next End Sub 在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮。然后编写如下的事件过程: Private Sub Command1_Click() Dim arr(5)As Integer, n As Integer For i=1 To 5 art(i)=i+i Next Fun arr, n Text
[单选题]在以下事件中,Private表示 Private Sub sub1(x As Integer,y As Integer) ...End SubA.此过程可以被其他过程调用B.此过程只可以被本窗体模块中的其他过程调用C.此过程不可以被任何其他过程调用D.此过程只可以被本工程中的其他过程调用
[单选题]已知有下面过程: Private Sub proc1(a As Integer,b As String,Optional x As Boolean) ...... End Sub 正确调用此过程的语句是______。A.Call procl(5)B.Call procl 5,"abc",FalseC.procl(12,"abc",True)D.procl 5,"abc"