2012年计算机考试二级VB考点及习题(9)
2、运行程序单击窗体,在窗体上显示的内容是:16 20 Private Sub Form_Click() Dim n As Integer, m As Integer n = 1: m = 2 Print n + m + f(n, m) ; ’优先执行f函数,n,m变化后再运算 “+” n = 2: m = 1 Print f(n, m) + f(m, n) ’n,m第一次变化后,第二次以变化后的值再调用 End Sub Private Function f(n As Integer, m As Integer) n = n + m m = m + 3 f = n + m End Function 3、执行下面的程序,在窗体上显示的输出结果是______;如果将A语句改成:Call sub1(b+1,a),则在窗体上显示的输出结果是______。 Private Sub Form_Click() Dim a As Integer, b As Integer a = 1: b = 2 Call sub1(a, b) ’A Print a, b End Sub Private Sub sub1(x As Integer, ByVal y As Integer) x = x + y y = x + y End Sub 相关资料 |