单击命令按钮时,下列程序代码的运行结果为()。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
单击窗体时,下列程序代码的运行结果为()。Private Sub Test(x As Integer)x = x * 2 + 1If x < 6 ThenCall Test(x)End Ifx = x * 2 + 1Print "x="; xEnd SubPrivate Sub Form_Click()Test 2End Sub
A. 23 47
B. 23 23
C. 10 22
D. 5 11