更多"在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为,( "的相关试题:
[单项选择]在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为( )。
Private Function fun(x As Integer,y As Integer)
Static m As Integer
Static i As Integer
i=i+2
i=i+m+1
m=i+x+y
fun=m
End Function
Private Sub Command1_Click( )
Dim j As Integer,m As Integer,k As Integer
j=4:m=1
k=fun(j,m)
Print k;
k=fun (j,m)
Print k
End Sub
A. 8 18
B. 7 17
C. 7 19
D. 8 19
[单项选择]在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为( )。
Private Sub fun3(x As Integer)
Static a As Integer
Dim b As Integer
a=a+3:b=b+3
a=a+x:b=b+x
Printa;b
End Sub
Private Sub Command1_Click( )
Dim k As Integer,m As Integer,n As Integer
k=2:m=1
Call fun3(k)
Call fun3(m)
End Sub
A. 5 5
B. 5 5
C. 5 5
D. 5 5
[单项选择]在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为,( )。
Private Sub fun(ByVal x As Integer,ByVal y As Integer,Byval z As Integer)
z=x^3*y^3
End Sub
Private Sub Command1_Click( )
Dim m As Integer
Call fun(2,3,m)
Print m
End Sub
A. 216
B. 0
C. 35
D. 程序不能运行
[单项选择]在窗体上画一个命令按钮,然后编写如下代码: Private Type Record ID As Integer Name As String * 20 End Type Private Sub Command1_Click( ) Dim MaxSize, NextChar, MyChar Open "d:/vb/tt. txt" For Input As #1 MaxSize = LOF(1) For NextChar = MaxSize To 1 Step - 1 Seek # 1, NextChar MyChar = Input(1, # 1) Next NextChar Print EOF(1) Close $1 End Sub 假设文件d:/vb/tt. txt 的内容为 Hello eveybody! 那么程序运行后,单击命令按钮,其输出结果为 ______。
A. True
B. False
C. 0
D. Null
[单项选择]在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为( )。
Option Base 1
Private Sub fun (a( )As Integer,n As Integer)
For i=1 To 2
t=a(i):a(i)=a(5-i+1):a(5-i+1)=t
Next i
End Sub
Private Sub Command1_Click( )
Dim arr1(5)As Integer
For i=1 To 5
arr1(i)=i
Next i
Call fun(arr1,5)
Print arr1(1);arr1(2)
End Sub
A. 1 2
B. 2 1
C. 5 4
D. 4 5
[填空题]在窗体上画一个命令按钮,然后编写如下代码:
Private Type Record
R_ID As Integer
R_Name As String * 20
Ene Type
Private Sub Commandl_Click( )
Dim M _Sise, N_Char, M_Char
Open" c: /file. txt" For Input As #1
M_sise=LOF(1)
For N_Char = M_Sise To 1 Step - 1
Seek#1, Next Char
M_char = Input(1 ,#1)
Next
Print EOF(1)
Close#1
End Sub
程序运行后,单击命令按钮,其输出结果为 【15】 。
[单项选择]在窗体上画一个命令按钮,然后编写如下程序:
Option Base 1
Private Sub Command1_Click( )
Dim Arr1(12)As Integer, Arr2(3)As Integer
Dim Sum As Integer
Sum = 2
For i = 1 To 12
Arr1(i)= i
Next i
For i = 1 To 3
Arr2(i)= Arr1(i * i)
Next i
For i = 1 To 3
Sum = Sum + Arr2(i)
Next i
Print Sum
End Sub
程序运行后,单击命令按钮,在窗体上的输出结果是________。
A. 16
B. 24
C. 32
D. 36
[填空题]在窗体上画一个命令按钮,然后编写如下事件过程:
Option Base 1
Private Sub Command1_Click( )
Dim a
a=Array(1,2,3,4)
j=1
For i=4 To 1 Step-1
s=s+a(i)*j
j=j*10
Next i
Print s
End Sub
运行上面的程序,单击命令按钮,其输出结果是 【15】 。