C # Code for Boundary elements of a Matrix
using System ; class GFG { public static void printBoundary ( int [ , ] a , int m , int n ) { for ( int i = 0 ; i < m ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( i == 0 ) Console . Write ( a [ i , j ] + " ▁ " ) ; else if ( i == m - 1 ) Console . Write ( a [ i , j ] + " ▁ " ) ; else if ( j == 0 ) Console . Write ( a [ i , j ] + " ▁ " ) ; else if ( j == n - 1 ) Console . Write ( a [ i , j ] + " ▁ " ) ; else Console . Write ( " ▁ " ) ; } Console . WriteLine ( " ▁ " ) ; } }