运行下列程序,窗体中的显示结果是:x= 。
Option Compare Database
Dim x As Integer
Private Sub Form_Load()
x=3
End Sub
Private Sub Commandll_ Click()
Static a As Integer
Dim b As Integer
b=x^2
funl x,b
funl x,b
MsgBox〝x=〞&x
End Sub
Sub funl(ByRef y As Integer,ByVal z As nteger)
y=y+z
z=y-z
End Sub
第1题:
运行下列程序:
Private Sub form_Click( )
x = 8: y = 2
Call fun1((x), y)
Print x, y
End Sub
Private Sub fun1(x, y)
s = x
x = s / y
y = s Mod y
End Sub
单击窗体后,则在窗体上显示的结果是( )。
A.4 2
B.8 2
C.8 0
D.2 4
第2题:
运行下列程序:
Private Sub Form_Click( )
Dim a As Integer
a = 1
For i = 1 To 5
Call fun1(a)
Next i
Print a
End Sub
Private Sub fun1(x)
y = 2
Do
x = x + y
Loop Until x > 10
End Sub
单击窗体后,则在窗体上显示的结果是( )。
A.5
B.1 2 3 4 5
C.19
D.7
第3题:
(11)运行下列程序,窗体中的显示结果是:x= 【11】 。
Option Compare Database
Dim x As Integer
Private Sub Form_Load()
x=3
End Sub
Private Sub Command11_Click()
Static a As Integer
Dim b As Integer
b=x^2
fun1 x,b
fun1 x,b
MsgBox "x="&x
End Sub
Sub fun1(ByRef y As Integer,ByVal z As Integer)
y=y+z
z=y-z
End Sub
第4题:
运行下列程序:
Private Sub Form_Click( )
Dim y As Integer, x As Integer
Do Until x > 20
x = x + 10
y = y + x
If x > 20 Then Exit Do
Loop
Print x, y
End Sub
单击窗体后,则在窗体上显示的结果是( )。
A.10 20
B.30 60
C.10 30
D.20 60
第5题:
运行下列程序:
Dim b
Private Sub Form_Click( )
a = 1: b = 1
Call fun1(a)
Print "X = "; a; ",Y = "; b
End Sub
Private Sub fun1(a)
b = 2 * a
a = 3 * b
End Sub
单击窗体后,则在窗体上显示的结果是( )。
A.X = 1,Y = 1
B.X = 2,Y = 6
C.X = 6,Y = 2
D.X = 6,Y = 1