Module Module1
Sub Main()
Dim matrix(,) As Integer = New Integer(,) {{13, 22, 43, 34},
{43, 54, 67, 98},
{88, 79, 11, 998}}
Console.WriteLine(sum_array(matrix))
End Sub
Function sum_array(matrix(,) As Integer) As Integer
Dim rows = matrix.GetUpperBound(0)
Dim cols = matrix.GetUpperBound(1)
Dim sum As Integer = 0
For i As Integer = 0 To rows
For j As Integer = 0 To cols
sum += matrix(i, j)
Next
Next
Return sum
End Function
End Module
' run:
'
' 1550