public static void Main()
int[,] matA = new int[10,10];
Console.Write("\nEnter the no. of row: ");
m = Convert.ToInt16(Console.ReadLine());
Console.Write("Enter the no. of col: ");
n = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("\nEnter the element in the matrix: ");
for(row=1; row<=m; row++)
for(col = 1; col<=n; col++)
Console.Write("Matrix A[{0},{1}]: ", row, col );
matA[row,col] = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Matrix A :");
for(row=1; row<=m; row++)
for(col = 1; col<=n; col++)
Console.Write("{0:D2} ", matA[row,col]);
Console.WriteLine("Matrix A\':");
for(row=1; row<=n; row++)
for(col = 1; col<=m; col++)
Console.Write("{0:D2} ", matA[col,row]);