Imports System
Public Class Program
Public Shared Sub Main(ByVal args As String())
Dim matrix = New Integer(,) {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9},
{10, 11, 12}}
Dim rows As Integer = matrix.GetLength(0)
Dim cols As Integer = matrix.GetLength(1)
For i As Integer = 0 To rows - 1
For j As Integer = 0 To cols - 1
Console.Write("{0,3:D}", matrix(i, j))
Next
Console.WriteLine()
Next
End Sub
End Class
' run:
'
' 1 2 3
' 4 5 6
' 7 8 9
' 10 11 12
'