单击命令按钮时,下列程序的运行结果为 Private Sub Command1_Click( ) Print MyFund(20,18) End Sub Public Function MyFund(m As Integer,n As Integer)As Integer Do While m◇n Do While m>n:m=m-n:Loop Do While m<n:n=n-m:Loop Loop MyFund=m End Function
A.0
B.2
C.4
D.6
第1题:
在窗体上画一个命令按钮(名称为Command1),然后编写如下事件过程: Private Sub Command1_Click() b=5 c=6 Print a=b+c End Sub 程序运行后,单击命令按钮,输出的结果是 ______。
A.a=11
B.a=b+c
C.a=
D.假
第2题:
在窗体上画1个命令按钮,名称为Command1,然后编写如下程序: Dim Flag As Boolean Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox(“请输入:”) If Flag Then Print f(intNum) End If End Sub Function f(X as Integer)As Integer If X<10 Then Y=X Else Y=X+10 End If f=Y End Function Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X as Single,Y As Single) Flag=True End Sub 运行程序,首先单击窗体,然后单击命令按钮,在输入对话框中输入5,则程序的输出结果为______。
A.0
B.5
C.15
D.无任何输出
第3题:
单击命令按钮时,下列程序的执行结果是
Private Sub Command1_Click()
BT 4
End Sub
Private Sub BT(x As Integer)
x=x * 2 + 1
If x < 6 Then
Call BT(x)
End If
x=x * 2
Print x;
End Sub( )。
A.15
B.16
C.17
D.18
第4题:
阅读下列程序: Function func(n As Integer)As Integer Sum = 0 For i = 1 To n Sum = Sum + (i + 1)* i Next i func = Sum End Function.Private Sub Command1_Click () Dim a As Integer a= 5 s = func (A)Print s End Sub 程序运行后,单击命令按钮,输出的结果为
A.80
B.60
C.70
D.15
第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题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() a S="VisualBasic" Print String(3, a$) End Sub 程序运行后,单击命令按钮,在窗体上显示的内容是______。
A.VVV
B.Vis
C.sic
D.11
第7题:
在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() A="12" B="34" C="56" Print A+B+C End Sub 程序运行后,单击命令按钮,输出结果是( )。
A."123456"
B.123456
C.102
D.显示出错信息
第8题:
工程中有两个窗体,名称分别为Form1、Form2,Fonn1为启动窗体,该窗体上有命令按钮 Command1。要求程序运行后单击该命令按钮时显示Form2,则按钮Click事件过程应该是 ______。
A.Private Sub Command1_click() Foma2.Show End Sub
B.Private Sub Command1_Click() Form2.Visible End Sub
C.Private Sub Command1_Click() Load Form2 End Sub
D.Private Sub Command1_click() Form.Load EndSub
第9题:
单击命令按钮时,下列程序的执行结果是
Private Sub Command1_Click()
BT 4
End Sub
Private Sub BT(x As Integer)
x=x*2+1
If x<6 Then
Call BT(x)
End If
x=x*2
Print x;
End Sub
A.15
B.16
C.17
D.18
第10题:
有下列程序: Option Base 0 Private Sub Command1_Click() Dim City As Variant x = Array("Visual","Basic","Microsoft","Programming") Print x(2) End Sub 程序运行后,单击命令按钮,则在窗体上显示的内容是
A.Microson
B.错误提示
C.Visual
D.Basic