Driver code
public static void Main ( ) { int [ , ] mat = { { 4 , 1 , 3 } , { 9 , 6 , 8 } , { 5 , 2 , 7 } } ; int n = 3 ; Console . Write ( " Original ▁ Matrix : STRNEWLINE " ) ; printMat ( mat , n ) ; sortMatRowAndColWise ( mat , n ) ; Console . Write ( " STRNEWLINE Matrix ▁ After ▁ Sorting : STRNEWLINE " ) ; printMat ( mat , n ) ; } }