下面程序的运行结果为()。Dim a%, b%, c%Sub p1(x%, y%) Dim c As Integer x = 2 x: y = y + 2: c = x + yEnd SubSub p2(x%, ByVal y%) Dim c As Integer x = 2 * x: y = y + 2: c = x + yEnd SubPrivate Sub Command1_Click() a = 2: b = 4: c = 6 Call p1(a, b) Call p2(a, b) Print a
下面程序的运行结果为()。Dim a%, b%, c%Sub p1(x%, y%) Dim c As Integer x = 2 x: y = y + 2: c = x + yEnd SubSub p2(x%, ByVal y%) Dim c As Integer x = 2 * x: y = y + 2: c = x + yEnd SubPrivate Sub Command1_Click() a = 2: b = 4: c = 6 Call p1(a, b) Call p2(a, b) Print a; b; cEnd Sub
A. 4 6 6
B. 8 6 6
C. 4 6 10
D. 8 8 6
正确答案:8 6 6
Tag:VisualBasic程序设计 程序
时间:2021-11-29 15:20:46
- 上一篇:在窗体上画一个命令按钮(名称为Command1),并编写如下代码:Function Fun1(ByVal a As Integer, b As Integer) As Integer Dim t As Integer t = a – b b = t + a Fun1 = t + bEnd Function Private Sub Command1_Click() Dim x As Integer x = 10 Print Fun1(Fun1(x, (Fun1(x, x – 1))), x – 1)End
- 下一篇:下面程序:Function a(x) Static b As Integer b = b + x ^ 2 Print bEnd Function Private Sub Command1_Click() Dim c% c = a(2)End Sub单击两次命令按钮,第二次显示的结果是()。