有下列两个过程:Sub S1(ByVal x As Integer,ByVal y As Integer)Dim t As Integert=xx=yy=tEnd SubSub S2(x As Integer,y As Integer)Dim t As Integert=xx=yy=tEnd Sub则下列叙述中正确的是( )。A.用过程S1可以实现交换两个变量的值的操作,S2不能实现B.用过程S2可以实现交换两个变量的值的操作,S1不能实现C.用过程S1和S2都可以实现交换两个变量的值的操作D.用过程S1和S2都不能实现交换两个变量的值的操作

有下列两个过程:

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都不能实现交换两个变量的值的操作


相关考题:

( 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 )

有下列函数过程: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

有如下函数过程:Function HFC(ByVal x As Integer, ByVal y As Integer) As IntegerDo While y 0sic=x / yx=yy=sicLoopHFC=xEnd Function以下是该函数的调用过程,该程序的运行结果是Private Sub Command1_Click()Dim a As IntegerDim b As Integera=12b=2x=HFC(a, B.Print xEnd Sub( )。A.0B.6C.2D.80

下列函数过程的作用是计算x和y的最大公约数。请填空。Private Sub Command1_ Click()Dim x As Integer, y As Integer, Result As Integerx = InputBox (“请输入第一个数”)y = InputBox (“请输入第二个数”)Result =______Print x; "和"; y; "的最大公约数为: "; ResultEnd SubPrivate Function GYS (ByVal A As Integer, ByVal B As Integer)Dim T As IntegerT = A Mod BDo While ______A = BB = TT = A Mod BLoop______End Function

在窗体上画一个命令按钮,然后编写如下程序: 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=10B.a=30 b=30C.a=10 b=30D.a=10 b=10

在窗体上画一个名称为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.8B.2C.5D.11

(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不能实现交换两个变量的值的操作

以下过程的定义中,( )是错误的。 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%)

单击命令按钮,下列事件过程的执行结果为 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 SubA.0 8B.40 72C.4 50D.78 50

有以下函数过程: 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 SubA.0B.10C.50D.100

单击命令按钮时,下列程序的执行结果为 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 SubA.12 32B.2 32C.2 3D.12 3

在窗体上画一个命令按钮,然后编写如下程序:Sub S1(ByVal x As Integer, By Val y As Integer) Dim t As Integer t=x x=y y=tEnd SubPrivate Sub Command1_ Click() Dim a As Integer, b As Integer a=10 b=30 S1 a,b Print "a=";a="b=";bEnd Sub 程序运行后,单击命令按钮,输出结果是______。A.a=30 b=10B.a=30 b=30C.a=10 b=30D.a=10 b=10

单击命令按钮时,下列程序段的执行结果为( )。 Private Sub Command1_Click() Dim a As Integer, b As Integer, c As Integer a-2:b=4:c=6 Call S1(a,b)Print "a="; a; "b="; b; "c="; c Call S2(a,b)Print "a ="; a; "b="; b; "c="; c; End Sub Private Sub S1(x As Integer, y As Integer) Dim c As Integer x=2*x:y=y+2:c=x+y End Sub Sub S2(x As Integer, ByVal y As Integer) Dim e As Integer x=2*x:y=y+2:e=x+y End SubA.a=4 b=6 c=6 a=4 b=6 c=6B.a=8 b=6 c=6 a=8 b=6 c=6C.a=4 b=6 c=6 a=8 b=6 c=6D.a=8 b=6 c=6 a=4 b=6 c=6

假定有以下两个过程: Sub S1(ByVal x As Integer, ByVal y As Integer) Dim t As Integer t=K x=y y=t End Sub Sub S2(x As Integer, y As Integer) Dim t As Integer t=K x=y y=t End Sub 则以下说法中正确的是 ( )A.用过程S1可以实现交换两个变量值的操作,S2不能实现B.用过程S2可以实现交换两个变量值的操作,S1不能实现C.用过程S1和S2都可以实现交换两个变量值的操作D.用过程S1和S2都不能实现交换两个变量值的操作

有如下函数过程: Function funl(ByVal x As Integer,ByVal y As Integer)As Integer Do While y<>0 reminder=x Mod y x=y y=reminder Loop fun1=x End Function 在下列按钮单击事件中调用该函数,则该程序的运行结果是( )。 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100 b=25 x=funl(a,B)Print x End SubA.0B.25C.50D.100

有如下函数过程。Function UNC(ByVal x As Integer,ByVal y As Integer)As IntegerDo While y<>0S=x/yx=yy=SLoopUNC=xEnd Function以下事件调用该函数,程序运行结果是【 】。Private Sub Command1_Click()Dim a As IntegerDim b As Integera=12b=2x=UNC(a,b)Print xEnd Sub

有如下事件过程: Function UNC (ByVal x As Integer,ByVal y As Integer) As Integer Do While y<>0 sic=x/y x=y y=sic Loop UNC=x End Function 以下是该函数的调用过程,该程序的运行结果是 PriVate Sub COmmand1_Click() Dim a As Integer Dim b As Integer a=12 b=2 x=UNC (a,B)Print x End SubA.0B.6C.2D.80

要想在过程Proc调用后返回形参x和Y的变化结果,下列定义语句中正确的是( )。【考点5过程调用与参数传递】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)

有如下函数过程: 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 Command7_Click() Dim s As Integer Dim b As Integer a=100 b=25 x=gys(a,B)Print x End SubA. 0B.25C.50D.100

假定有以下两个过程: Sub SI (By Val x As Integer,By Val 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都不能实现交换两个变量的俏的操作

在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub sub1(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 sub1(1, 2,A)Print a End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.8B.2C.5D.11

有以下函数过程: Function Gys(ByVal x As Integer,ByVal y As Integer)As Integer Do While y< 0 Remender=x Mod v 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=Cys(a,B)Print x End subA.0B.10C.50D.100

假定有以下两个过程: 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 Infeger) Dim t As Integer t=x x=y y=t End Sub 则以下说法中正确的是______。A.用过程S1可以实现交换两个变量的值的操作,S2不能实现B.用过程S2可以实现交换两个变量的值的操作,S1不能实现C.用过程S1和S2都可以实现交换两个变量的值的操作D.用过程S1和S2都不能实现交换两个变量的值的操作

有下列两个过程: Sub S1(By Val x As Integer, By Val 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都不能实现交换两个变量的值的操作

单击命令按钮时,下列程序的执行结果为 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 SubA.1232B.232C.23D.123

假定有以下两个过程: Sub Sl(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都不能实现交换两个变量的值的操作

以下定义的过程()是按“传值”方式传递参数的。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%)