2.下面程序段运行后输出的结果是________.VB.NET题Dim i As IntegerDim a() As Integer={1,2,3,4,5,6,7,8,9}For i=0 To UBound(a)a(i)=a(i)*a(i)Next iMsgBox(a(2))
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/17 07:37:08
2.下面程序段运行后输出的结果是________.VB.NET题DimiAsIntegerDima()AsInteger={1,2,3,4,5,6,7,8,9}Fori=0ToUBound(a)a(i
2.下面程序段运行后输出的结果是________.VB.NET题Dim i As IntegerDim a() As Integer={1,2,3,4,5,6,7,8,9}For i=0 To UBound(a)a(i)=a(i)*a(i)Next iMsgBox(a(2))
2.下面程序段运行后输出的结果是________.
VB.NET题
Dim i As Integer
Dim a() As Integer={1,2,3,4,5,6,7,8,9}
For i=0 To UBound(a)
a(i)=a(i)*a(i)
Next i
MsgBox(a(2))
2.下面程序段运行后输出的结果是________.VB.NET题Dim i As IntegerDim a() As Integer={1,2,3,4,5,6,7,8,9}For i=0 To UBound(a)a(i)=a(i)*a(i)Next iMsgBox(a(2))
首先定义了数组a,分别赋值,其中a(2)=3然后继续赋值a(2)=a(2)*a(2)=9
所以输出为9
PS:ubound函数为返回数组的上界