单击命令按钮时,下列程序的执行结果为 Private Sub Command1_Click Dim x As Integer, y As Integer x=12:y=32 Call Proc(x,y. Print x; y End Sub Public Sub Proc(n As Integer, ByVal m As Integer. n=n Mod 10 m=m Mod 10 End Sub
A.1232
B.232
C.23
D.123
第1题:
单击命令按钮时,下列程序的执行结果是
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
第2题:
单击命令按钮时,下列程序的执行结果为
Private Sub Command1_Click()
Dim x As Integer, y As Integer
x=12: y=32
Call PCS(x, y)
Print x; y
End Sub
Public Sub PCS(ByVal n As Integer, ByVal m As Integer)
n=n Mod 10
m=m Mod 10
End Sub( )。
A.12 32
B.2 32
C.2 3
D.12 3
第3题:
在窗体上画1个命令按钮,其名称为Command1,然后编写如下程序:
Private Sub Command1_Click()
Dim a(10)As Integer
Dim x As Integer
For i=1 To 10
a(i)=8+i
Next
x=2
Print a(f(x)+x)
End Sub
Function f(x As Integer)
x=x+3
f=x
End Function
程序运行后,单击命令按钮,输出结果为( )。
A.12
B.15
C.17
D.18
Function过程中的x与事件过程Command1_Click中的x使用的是同一地址,因此在Function过程中执行x=x+3这一语句时,事件过程Command1_Click中的x也同时执行该语句,因此Print函数的内容是a(f(2)+2+3)=a(10),因而输出应该为18。
第4题:
在窗体上画一个命令按钮,然后编写如下事件过程:
PrivateSubcommand1_click()
DimaAsString,bAsString
a=InputBox("EntertheFirstinteger")
b=InputBox("EntertheSecondinteger")
Printb+a
EndSub程序运行后,单击命令按钮,先后在两个输入对话框中分别输入456和111,则输出结果
是( )
A.456
B.111
C.567
D.111456
第5题:
在窗体中添加两个文本框(其Name属性分别为Text1和Text2)和一个命令按钮(Name属性为Command1),然后编写如下两个事件过程:
PrivateSubCommand1_Click()
a=UCase(Text1.Text)+Left(Text2.Text,2)
Printa
EndSub
PrivateSubForm_Load()
Text1.Text="Ab"
Text2.Text="123456"
EndSub
程序运行后,单击命令按钮,输出结果为( )
A.ab12
B.AB12
C.AB56
D.ab56
第6题:
单击命令按钮时,下列程序的执行结果为( )。 Private Sub Commandl_Click() Dimx As Integer,y As Integer x=12: y=32 CallPCS(x,y) PrintX;y End Sub PubUc Sub PCS(ByValn As Integer,ByValm As Integer) n=nMod 10 m=mMod 10 End Sub
A.1232
B.232
C.23
D.123
第7题:
单击命令按钮时,下列程序代码的执行结果为 ______。 Public Sub Procl(n As Integer,ByVal m As Integer) n=n Mod 10 m=m/10 End Sub Private Sub Command1_Click() Dim x As Integer,y As Integer x=12: y=34 Call Procl(x,y) Print x;y End Sub
A.12 34
B.2 34
C.2 3
D.12 3
第8题:
( 25 )在窗体上画 1 个命令按钮,其名称为 Command1 ,然后编写下列程序:
Private Sub Command1_Click( )
Dim a ( 10 ) As Integer
Dim x As Integer
For i=1 To 10
a(i)=8+i
Next
x=2
Print a(f(x)+x)
End Sub
Function f(x As Integer)
x=x+3
f=x
End Function
程序运行后,单击命令按钮,输出结果为( )。
A ) 12
B ) 15
C ) 17
D ) 18
第9题:
在窗体上画一个命令按钮,然后编写如下程序:
privatesubcommand1_click()
forj=1to11
j=j+1
n=n+1
nextj
Print"n=";n
endsub
程序运行后单击命令按钮,N的值是( )
A.5
B.6
C.10
D.11
第10题:
单击命令按钮时,下列程序代码的执行结果为______。 Private Sub Proe1 (n As Integer,ByVa1 m As Integer) n=n Mod 10 m=m\ 10 End Sub Private Sub Command1_Click() Dim x As Integer Dim y As Integer x= 12 y = 34 Call Proe1 (x, y) Print x; y End Sub
A. 12 34
B.2 34
C.2 3
D.12 3