有下列两个过程:
Sub S1(ByVal x As Integer,ByVal y As Integer)
Dim t As Integer
t=x
x=y
y=t
End Sub
Sub S2(x As Integer,y As Integer)
Dim t As Integer
t=x
x=y
y=t
End Sub
则下列叙述中正确的是( )。
A.用过程S1可以实现交换两个变量的值的操作,S2不能实现
B.用过程S2可以实现交换两个变量的值的操作,S1不能实现
C.用过程S1和S2都可以实现交换两个变量的值的操作
D.用过程S1和S2都不能实现交换两个变量的值的操作
第1题:
有如下函数过程:
Function HFC(ByVal x As Integer, ByVal y As Integer) As Integer
Do While y <> 0
sic=x / y
x=y
y=sic
Loop
HFC=x
End Function
以下是该函数的调用过程,该程序的运行结果是
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
a=12
b=2
x=HFC(a, B.
Print x
End Sub( )。
A.0
B.6
C.2
D.80
第2题:
在窗体上画一个命令按钮,然后编写如下程序: Sub S1(ByVal x As Integer,ByVal y As Integer) Dim t As Integer t=x x=y y=t End Sub Private Sub Command1_Click() Dim a As Integer,b As Integer a=10 b=30 S1 a,b Print"a=";a;"b=";b End Sub 程序运行后,单击命令按钮,输出结果是 ______。
A.a=30 b=10
B.a=30 b=30
C.a=10 b=30
D.a=10 b=10
第3题:
( 27 )要想在过程 Proc 调用后返回形参 x 和 Y 的变化结果,下列定义语句中正确的是
A ) Sub Proc ( x as Integer,y as Integer )
B ) Sub Proc ( ByVal x as Integer, y as Integer )
C ) Sub Proc ( x as Integer,Byval y as Integer )
D ) Sub Proc ( Byval x as Integer, Byval y as Integer )
第4题:
单击命令按钮,下列事件过程的执行结果为 Private Sub Command1_Click( ) Dim x As Integer, y As Integer x=40:y=72 Call PtoP(x, y) Print x; y End Sub Public Sub PtoP(Byval n AS Integer, ByVal m Aa Integer) n = n \ 10+2 m = m \ 10+2 End Sub
A.0 8
B.40 72
C.4 50
D.78 50
第5题:
(27)有下列两个过程: Sub S1(ByVal x As Integer,ByVal y As Integer) Dim t As Integer t=x x=y y=t End Sub Sub S2(x As Integer,y As Integer) Dim t As Integer t=x x=y y=t End Sub 则下列叙述中正确的是 A.用过程S1可以实现交换两个变量的值的操作,S2不能实现B.用过程S2可以实现交换两个变量的值的操作,S1不能实现 C.用过程S1和S2可以实现交换两个变量的值的操作 D.用过程S1和S2不能实现交换两个变量的值的操作
第6题:
下列函数过程的作用是计算x和y的最大公约数。请填空。
Private Sub Command1_ Click()
Dim x As Integer, y As Integer, Result As Integer
x = InputBox (“请输入第一个数”)
y = InputBox (“请输入第二个数”)
Result =______
Print x; "和"; y; "的最大公约数为: "; Result
End Sub
Private Function GYS (ByVal A As Integer, ByVal B As Integer)
Dim T As Integer
T = A Mod B
Do While ______
A = B
B = T
T = A Mod B
Loop
______
End Function
第7题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub subl(ByVal x As Integer, ByVal y As Integer, ByVal z As Integer) z=x*x+y*y End Sub Private Sub Command1_Click() Dim a As Integer a=8 Call subl(1, 2,a) Print a End Sub 程序运行后,单击命令按钮,则窗体下显示的内容是______。
A.8
B.2
C.5
D.11
第8题:
有下列函数过程:Function funl(ByVal x As Integer, ByVal y As Integer) Do While y <> 0 Reminder=x Mody x=y y=reminder Loop Funl=xEnnd Function在下列按钮单击事件中调用该函数,则该程序的运行结果是 Privatr Sub Commandl_Click() Dim a As Integer Dim b As Integer a=100 b=25 x=funl(a,b) Print x End SubA.0 B.25 C.50 D.100
第9题:
A、Public Sub Sum(x ; y)
B、Public Sub Sum(ByVal x, ByVal y)
C、Public Sub Sum(x As Integer,y As Integer)
D、Public Sub Sum(x%, y%)
第10题:
有以下函数过程: Function Gys (ByVal x As Integer, ByVal y As Integer) As Integer Do While y<>0 Reminder = x Mod y x = y y= Reminder Loop Gys=x End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a = 50 b = 10 x=Gys (a,B)Print x End Sub
A.0
B.10
C.50
D.100