有如下函数过程: Function secproc(x As Integer, y As Integer, z As Integer) secproc = 3 * y + z + 2 * x End Function Private Sub Command1_Click() Dim a As Integer, b As Integer, c As Integer a = 2: b = 3: c = 4 Print secproc(c, b, a) End Sub 该程序的运行结果是( )。
举一反三
- 运行下面的程序,第二行显示结果是___________。 Private Sub Form_Click() Dim A As Integer Dim i As Integer A = 5 For i = 1 To 9 Call sub1(i, A) Print i, A Next i End Sub Private Sub sub1(x As Integer, y As Integer) Static N As Integer Dim I As Integer For I = 3 To 1 Step -1 N = N + x x = x + 2 Next I y = y + N End Sub
- 编写如下程序: Private Sub Command1_Click() Dim x As Integer, y As Integer x = 1: y = 1 Do y = x * y If y > 10 Then Print x, y Exit Do Else x = x + 3 End If Loop While x <= 10 End Sub 运行程序,输出结果为______
- 窗体上有标签(Label1、Label2)和命令按钮(Command1),编写如下事件过程: Private x As Integer: Private Sub Command1_Click(): Dim x As Integer, y As Integer: x = 5: y = 3: proc x, y: Label1.Caption = x: Label2.Caption = y: End Sub: Private Sub proc(ByVal a As Integer, b As Integer): x = a + b: b = b * b: End Sub:运行后,单击按钮,Label1和Label2将分别显示
- 如下程序的运行结果是【1】. Private Sub Command1_Click() Dim x As Integer x = 12 f2 x Print x End Sub Public Sub f2(n As Integer) n = n Mod 10 End Sub
- 设有如下通用过程,在窗体上画一个名称为command1的命令按钮,然后编写如下事件过程: private sub command1_click() dim x as integer x=10 y=5 y=f(x) print x;y end sub public function f (x as integer) dim y as integer x=20 y=2 f=x*y end function 程序运行后,如果单击命令按钮,则在窗体上显示的内容是()