题目内容

设窗体上有一个Command1命令按钮,还有以下程序代码: Private Sub Command1_Click() Static x As Integer x = x + 1 Call proc(x) Print x, End Sub Private Sub proc(a As Integer) Static x As Integer x = x + a a = x End Sub 程序运行后,3次单击命令按钮,则产生的输出结果是( )

A. 1 2 3
B. 1 3 7
C. 2 4 6
D. 1 3 5

查看答案
更多问题

运行程序,单击窗体后输出结果是( )。 Private Sub Form_Click() Dim x%, y% x = 15: y = 10 Call f(x, y) Print x; y End Sub Private Sub f(ByVal x%, y%) x = x + y y = y + x End Sub

A. 25 10
B. 15 10
C. 25 35
D. 15 35

设程序中有如下数组定义和过程调用语句: Dim a(10) As Integer …… Call p(a) 以下过程定义中,正确的是( )。

A. Private Sub p(a(10) As Integer)
B. Private Sub p(a As Integer)
C. Private Sub p(a(n) As Integer)
D. Private Sub p(a() As Integer)

有如下的Sub子过程定义: Sub P(a%, b%) … End Sub 下面调用该过程正确的语句是( )。

A. P(10,20)
B. Call P 10,20
Call P
D. P 10,20

在窗体上画一个名称为Command1的命令按钮,然后编写如下代码: Public Sub S(x As Integer, y As Integer) Static z As Integer y = x * x + z z = y End Sub Private Sub Command1_Click() Dim i As Integer, y As Integer m = 0: y = 0 For i = 1 To 3 S i, y m = m + y Next Print m End Sub 程序运行后,单击命令按钮,在窗体上输出的内容是( )。

A. 7
B. 14
C. 50
D. 20

答案查题题库