在窗体上画一个名称为Command1的命令按钮,并编写如下程序:
Private Sub Command1_Click()
Dim x As Integer
Static y As Integer
x=10
y=5
Call f1(x,y)
Print x,y
End Sub
Private Sub f1(ByRef x1 As Integer, y1 As Integer)
x1=x1+2
y1=y1+2
End Sub
程序运行后,单击命令按钮,在窗体上显示的内容是
发布于 2022-05-11 10:19:47
登录后免费查看答案
关注者
0
被浏览
17
1 个回答
推荐阅读
-
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程:Private Sub Command1_Click()Static x As IntegerClsFor i=1 To 2y=y+xx=x+2NextPrint x,yEnd Sub程序运行后,连续三次单击Command1按钮后,窗体上显示的是
2022-05-11 关注 0 浏览16 1答案
-
单击按钮时,以下程序运行后的输出结果是Private Sub proc1(x As Integer, y As Integer, z As Integer)x=3 * zy=2 * zz=x + yEnd SubPrivate Sub Command1_Click()Dim x As Integer, y As Integer, z As Integerx=1: y=2: z=3Call proc1(x, x, z)Print x; x; zCall proc1(x, y, y)Print x; y; yEnd Sub
2022-05-11 关注 0 浏览54 1答案
-
在窗体上画一个名称为Commandl的命令按钮,然后编写如下程序:Private Sub Command1_Click()Static X As IntegerStatic Y As IntegerClsY=1Y=Y+5X=5+XPrint X,YEnd Sub程序运行时,三次单击命令按钮Commandl后,窗体上显示的结果为
2022-05-11 关注 0 浏览13 1答案
-
单击按钮时,以下程序运行后的输出结果是Private Sub Command1_Click()Dim x As Integer, y As Integer, z As Integerx=1: y=2: z=3Call God(x, x, z)Print x; x; zCall God(x, y, y)Print x; y; yEnd SubPrivate Sub God(x As Integer, y As Integer, z As Integer)x=3 * z + 1y=2 * zz=x + yEnd Sub
2022-05-11 关注 0 浏览88 1答案
-
在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序:Function M(x As Integer,y As Integer)As IntegerM=IIf(x>y,x,y)End FunctionPrivate Sub command1_Click()Dim a As Integer,b As Integera=100b=200Print M(a,b)End Sub 程序运行后,单击命令按钮,输出结果为______ 。
2022-05-11 关注 0 浏览19 1答案
-
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程:Private Sub Command1_Click()x = -5If Sgn(x) Theny = Sgn(x ^ 2)Elsey = Sgn(x)End IfPrint yEnd Sub程序运行后,单击命令按钮,窗体上显示的是
2022-05-11 关注 0 浏览9 1答案
-
标准模块中有如下程序代码:Public x As Integer,y As IntegerSub var_pub()x=10:y=20End Sub在窗体上有1个命令按钮,并有如下事件过程:Private Sub Command1_Click()Dim x As IntegerCall var_pubx=x+100y=y+100Print x;yEnd Sub运行程序后单击命令按钮,窗体上显示的是
2022-05-11 关注 0 浏览14 1答案
-
设有如下通用过程:Public Function f(x As Integer)Di my As Integerx=20y =2f =x*yEnd Function在窗体上画一个名称为Co mmand1的命令按钮,然后编写如下事件过程:Private Sub Co mmand1_Click()Static x As Integerx=10y =5y =f(x)Print x;yEnd Sub程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )。
2022-05-11 关注 0 浏览11 1答案
-
单击按钮时,以下程序运行后的输出结果是( )。Private Sub proc1(x As Integer ,y As Integer ,z As Integer)x=3*zy =2*zz =x+yEnd SubPrivate Sub Co mmand1_Click()Di mx As Integer ,y As Integer ,z As Integerx=1:y =2:z =3Call proc1(x,x,z)Print x;x;z Call proc1(x,y ,y)Print x;y ;yEnd Sub
2022-05-11 关注 0 浏览26 1答案
-
在窗体上画一个名称为Command1的命令按钮,再画两个名称分别为Label1、Label2的标签,然后编写如下程序代码:Private X As IntegerPrivate Sub Command1_Click()X = 5: Y = 3Call proc(X, Y)Label1.Caption = XLabel2.Caption = YEnd SubPrivate Sub proc(ByVal a As Integer, ByVal b As Integer)X = a * aY = b + bEnd Sub程序运行后,单击命令按钮,则两个标签中显示的内容分别是
2022-05-11 关注 0 浏览13 1答案