程序段如下,当发生Form_Click事件时,窗体上输出的结果是( )。 Option Explicit Private x As Integer Public y As Integer Sub Test() Dim y as integer x=2:y=2 Print"x1=";x;"y1=";y End Sub Private Sub Form_Click() x=1:y=1 Test Print "X2=";x;"y2=";y End Sub
A.x1=2 y1=2 x2=2 y2=1
B.x1=2 y1=2 x2=2 y2=2
C.x1=2 y1=1 x2=2 y2=2
D.x1=2 y1=1 x2=2 y2=1
第1题:
假定有如下事件过程: Privte Sub Form_Click0 Dim x As Integer,n As Integer x=1 n=0 Do While x<28 x=x*3 n=n+1 Loop Print x,n End Sub 程序运行后,单击窗体,输出结果是( )。
A.81 4
B.56 3
C.28 1
D.243 5
第2题:
(26)在窗体上放置一个命令按钮Command1,并编写下列单击事件的程序: Private Option Base 1 Sub Command1_Click() Dim c As Integer,d As Integer d=0 c=6 X=Array(2,4,6,8,10,12) For i=1 To 6 IfX(i)>c Then d=d+X(i) c=X(i) Else d=d-c End If Next i Print d End Sub 程序运行后,单击命令按钮,则在窗体上输出的结果是 。A.10 B.12 C.16 D.20
第3题:
在窗体上画一个名称为Labell的标签,然后编写如下事件过程: Option Base 1 Private Sub Form_Click() Dim a(20) As Integer For k=1 To 20 a(k)=k^2 Next k Label1.Caption=a(k) End Sub 程序运行后,单击窗体,在标签中显示的内容是 ______。
A.400
B.20
C.441
D.出错信息
第4题:
当Form_Click事件发生时,程序输出的结果是 ______。 Private Sub Form. Click() Dim a As Integer,b As Integer,c As Integer a=1: b=1 Print a; b Do c=a+b Print c a=b:b=c Loop Until c>=5 End Sub
A.1 1 1
B.2 3 5
C.2 5 7
D.2 3 4
第5题:
执行下面程序,第一行输出结果是【 】,第二行输出结果是47。
Option Explicit
Private Sub Form_Click( )
Dim A As Integer
A=2
Call Sub1 (A) End Sub
Private Sub1 (x As Integer)
x=x*2+1
If x<10 Then
Call Sub1 (x)
End If
x=x*2+1
Print x
End Sub
第6题:
在窗体上绘制一个名称为Command1的命令按钮,然后编写如下程序: Option Base 1 Private Sub Commandl_Click() Dim c As Integer,d As Integer d=0 c=6 x=Array(2,4,6,8,10,12) For i=1 To 6 If x(i)>c Then d=d+x(i) c=x(i) Else d=d-c End If Next i Print d End Sub 程序运行后,如果单击命令按钮,则在窗体上输出的内容为
A.10
B.16
C.12
D.20
第7题:
窗体上命令按钮Command1的事件过程如下:
End Sub 该程序执行后,输出结果是( )。



第8题:
以下程序运行时,单击窗体后,在窗体上输出的结果是 ______。 Private SubForm_Click() Dim a As Integer,b As Integer a=10 :b=20 Call ff(a,B)Print a,b End Sub Private Sub ff(x As Integer,y As Integer) x=x+y y=x+y End Sub
A.30 50
B.30 30
C.20 20
D.10 20
第9题:
当Form_Click;事件发生时,窗体上显示的第三行是 ______。 Private Sub Form_Click() Dim i As Integer, j As Integer, k As Integer Dim x(5, 5) As Integer For i = 1 To 5 k = 1 For j = 1 To 5 If i <= j Then x(i, j) = k + 1 k=k+2 Else x(i, j) = k + 1 End If Next j Next i For i = 1 To 5 For j = 1 To 5 Print x(i, j) Next j Print Next i End Sub
A.22135
B.21357
C.22213
D.13579
第10题:
当发生Form_Click事件时,下列程序的输出结果是( )。 Private m As Integer,n As Integer Private Sub Form_Click() Dim k As Integer,p As Integer k=6:p=60 Call sub1(k,p) Print m,n,m,k,p Call sub1(k,p) Print m,n,k,p End Sub Private Sub Form_Load() m=7 n=70 End Sub Public Sub sub1(x As Integer,ByVal y As Integer) Dim m As Integer n=n+5 m=n+x+y x=x+y y=x+y End Sub
A.7 75 66 60 7 80 126 60
B.7 75 66 60 7 75 126 60
C.7 75 66 60 7 80 66 60
D.7 75 66 60 7 75 66 60
第11题:
运行下列程序:
Private Sub Form_Click( )
Dim x As Integer, y As String, z As String
y = "12345"
For x = 1 To Len(y)
z = Mid(Left(y, x), 1)
Next x
Print z
End Sub
单击窗体后,则在窗体上显示的结果是( )。
A.1
B.11111
C.55555
D.12345
第12题:
当发生Form_Click事件时,窗体上显示的第三行是( )。 Option Base 1 Private Sub Form_Click() Dim i As Integer,j As Integer,k As Integer Dim a(5,5)As Integer For i=1 To 5 k=1 For i=1 To 5 If(i<=j)Then a(i,j)=k k=k+2 Else a(i,j)=k+1 End If Next j Next i For i=1 To 5 For j=1 To 5 Print a(i,j); Next j Print Next i End Sub
A.1 3 5 7 9
B.2 1 3 5 7
C.2 2 2 1 3
D.2 2 1 3 5
第13题:
有如下程序: Private Sub Form_Click() Dim i As Integer,Sum As Integer Sum=0 For i=2 To 10 If i Mod 2<>0 And i Mod 3=0 Then Sum=Sum+i End If Next Print Sum End Sub 程序运行后,单击窗体,输出结果为
A.12
B.30
C.24
D.18
第14题:
假定有如下事件过程:
Private Sub Form_Click()
Dim x As Integer, n As Integer
x = 1
n = 0
Do While x < 28
x = x * 3
n = n + 1
Loop
Print x, n
End Sub
程序运行后,单击窗体,输出结果是( )。
A.81 4
B.56 3
C.28 1
D.243 5
第15题:
在窗体上画一个命令按钮,其名称为Commandl,然后编写如下程序:
Function a(x As Integer, y As Integer) As Integer
a = IIf(x > y, x, y)
End Function
Private Sub Command1_Click()
Dim n As Integer, m As Integer
n = 10
m = 20
Print a(n, m)
End Sub
程序运行后,单击命令按钮,输出结果是______。
第16题:
有如下程序: Private Sub Form_Click( ) Dim i As Integer, Sum As Integer Sum = 0 For i = 2 To 10 If i Mod 2=0 And i Mod 3<>0 Then Sum = Sum + i End If Next Print Sum End Sub 程序运行后,单击窗体,输出结果为
A.12
B.30
C.24
D.18
第17题:
假定有如下事件过程: Privte Sub Form_Click() Dim x As Integer,n As Integer x=1 n=0 Do While x<28 x=x*3 n=n+1 Loop Print x,n End Sub 程序运行后,单击窗体,输出结果是
A.81 4
B.56 3
C.28 1
D.243 5
第18题:
在窗体上没有进行任何属性设置,然后编写如下事件过程,则程序运行结果是( )。
A. 在窗体上输出55
B. 在窗体上输出sum=55
C. 出错
D. 窗体上不输出
第19题:
设有如下程序:
Prirate Sub Form_Click()
Dim a As Integer,b AS Integer
a=20:b=50
p1 a,b
p2 a,b
p3 a,b
Print"a=";a,"b=";b
End Sub
Sub p1(x As Integeh By Val y As Integer)
x=x+10
y=y+20
End Sub
Sub p2(ByVal x As Integer,y As Integer)
x=x+10
y=y+20
End Sub
Sub p3 (ByVal x As Integer,ByVal y As Integer)
x=x+10
y=y+20
End Sub
该程序运行后,单击窗体,则在窗体上显示的内容是:a= ______ 和b= _____。
第20题:
编写如下事件过程: Option Explicit Private Sub Form_Click() Dim Str As String, I As Integer Open "examp" For Output As 1 For I=1 To 5 Str=Chr(I+64) Print #1,Str; Next I Close 1 Open”examp',For lnput AS 2 Str=Input(10,#2) Print Str; Close 2 End Sub 程序运行后,单击窗体,则窗体上显示的内容是
A.ABCDE
B.96
C.65
D.abcde
第21题:
在窗体上放置一个命令按钮Command1,并编写下列单击事件的程序: Option Base 1 Private Sub Command1_Click() Dim c As Integer,d As Integer d=0 c=6 X=Array(2,4,6,8,10,12) For i=1 To 6 If X(i)>c Then d=d+X(i) c=X(i) Else d=d-c End If Next i Print d End Sub 程序运行后,单击命令按钮,则在窗体上输出的结果为( )。
A.10
B.12
C.16
D.20
第22题:
程序代码如下,当单击窗体上的Command1控件时,在窗体上输出的结果是( )。 Private Sub Command1_Click() Dim aa(3,3)As Integer Dim i As Integer,j As Integer Dim s As Integer For i=0 To 3 For j=0 To 3 aa(i,j)=i*4+j+1 Next j Next i For i=0 To 3 s=s+aa(i,1) Next i Print s End Sub
A.32
B.28
C.30
D.36
第23题:
运行下列程序:
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