Function Product(Arr())
Dim Result, I
Result = 1
For I = LBound(Arr) To UBound(Arr)
Result = Result * Arr(I)
Next I
Product = Result
End Function
Sub Main_hw01_2()
Dim A(2)
A(0) = -2: A(1) = -1: A(2) = 3
Debug.Print Product(A)
End Sub
Sub Main_hw01_3()
Dim A(2), B(2)
A(0) = 2: A(1) = 3: A(2) = 1
B(0) = 3: B(1) = -2: B(2) = 1
AddArrays A, B
For I = LBound(A) To UBound(A)
Debug.Print A(I)
Next I
End Sub
The program should print 5, 1, and 2.
If the array ranges are mis-matched, your subroutine should only
add matching indices, and ignore the rest.
Sub Main_hw01_4()
Dim A(1, 1) As Integer
A(0, 0) = 2: A(0, 1) = 3
A(1, 0) = 3: A(1, 1) = 4
Debug.Print IsSymmetric(A)
A(0, 1) = 0
Debug.Print IsSymmetric(A)
End Sub
The program should print True, False.