若已经编写一个Sort子过程,在该工程中有多个窗体,为了方便调用Sort子程序,应该将子过程放在()中
A. 工程
B. 标准模块
C. 窗体模块
D. 类模块
查看答案
单击命令按钮时,下列程序代码的运行结果为()。Public Sub Procl(ByVal n As Integer, m As Integer)n = n Mod 10m = m \ 10End SubPrivate Sub Command1_Click()Dim x As Integer, y As Integerx = 23y = 65Call Procl(x, y)Print x; yEnd Sub
A. 3 60
B. 0 65
C. 3 65
D. 23 6
在窗体上添加一个命令按钮Command1,编写代码如下:Function f(x As Integer)x = x + 3f = xEnd FunctionPrivate Sub Command1_Click()Dim a(10) As IntegerDim x As IntegerFor i = 1 To 10a(i) = 8 + iNextx = 2Print a(f(x) + x)End Sub程序运行后,单击命令按钮,显示结果为()。
A. 15
B. 17
C. 12
D. 18
设有如下程序代码:Private Function Fc(ByVal n As Integer) As IntegerFc = n * Fj(5)End FunctionPrivate Function Fj(ByVal n As Integer) As IntegerFj = n + 3End FunctionPrivate Sub Command1_Click()Dim a As Integera = 3Form1.Print Fc(a)End Sub程序时单击命令按钮,在窗体上输出的结果为( )。
A. 24
B. 5
C. 3
D. 15
在窗体上添加一个命令按钮Command1,然后编写如下程序:Function Func(ByVal x As Integer, y As Integer)y = y * xIf y > 0 ThenFunc = xElseFunc = yEnd IfEnd FunctionPrivate Sub Command1_Click()Dim a As Integer, b As Integera = 3b = 4c = Func(a, b)Print a; b; cEnd Sub程序运行后,单击命令按钮,其显示结果为()。
A. 3 4 3
B. 3 12 3
C. 3 4 12
D. 3 12 12