using System;
public class PrintSpecificRowOfMatrix_CSharp
{
public static void PrintSpecificRowOfMatrix(int[,] matrix, int row) {
int cols = matrix.GetUpperBound(1) + 1;
for (int j = 0; j < cols; j++) {
Console.Write(matrix[row, j] + " ");
}
}
public static void Main(string[] args)
{
int[,] matrix = new int[,]
{
{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}
};
int row = 2;
PrintSpecificRowOfMatrix(matrix, row);
}
}
/*
run:
9 17 89 2 7 5
*/