Imports System
Public Class PrintSpecificRowOfMatrix_VB
Public Shared Sub PrintSpecificRowOfMatrix(ByVal matrix As Integer(,), ByVal row As Integer)
Dim cols As Integer = matrix.GetLength(1)
For j As Integer = 0 To cols - 1
Console.Write(matrix(row, j) & " ")
Next
End Sub
Public Shared Sub Main(ByVal args As String())
Dim matrix(,) As Integer = New Integer(,) {
{4, 7, 9, 18, 29, 0},
{1, 9, 18, 99, 4, 3},
{9, 17, 89, 2, 7, 5},
{19, 49, 6, 1, 9, 8},
{29, 4, 7, 9, 18, 6}
}
Dim row As Integer = 2
PrintSpecificRowOfMatrix(matrix, row)
End Sub
End Class
' run:
'
' 9 17 89 2 7 5
'