单选题 下面程序运行后,输出结果是______。
Private Sub mysub(b()As Integer,Optional ByVal n As Integer=2)
For I=1 to 4
b(I)=n*I
Next I
End Sub
Private Sub Command1_Click()
Dim a(1 to 4)As Integer,I As Integer
Call mysub(a(),5)
Mysub a()
ForI=1 to 4
Print a(i);
Next
End Sub
A 1 5 10 15 20 B.2 4 6 8 C.出错 D.0 0 0 0
【正确答案】 B
【答案解析】[解析] byval表示按值传递。注意本题指定了n=2,所以数组值分别是2,4,6,8。