public static void Main()
int i,j,k,r1,c1,r2,c2,sum=0;
int[,] arr1 = new int[50,50];
int[,] brr1 = new int[50,50];
int[,] crr1 = new int[50,50];
Console.Write("\n\nMultiplication of two Matrices\n");
Console.Write("----------------------------------\n");
Console.Write("\nInput the number of rows and columns of the first matrix :\n");
Console.Write("Rows : ");
r1 = Convert.ToInt32(Console.ReadLine());
Console.Write("Columns : ");
c1 = Convert.ToInt32(Console.ReadLine());
Console.Write("\nInput the number of rows of the second matrix :\n");
Console.Write("Rows : ");
r2 = Convert.ToInt32(Console.ReadLine());
Console.Write("Columns : ");
c2 = Convert.ToInt32(Console.ReadLine());
Console.Write("Mutiplication of Matrix is not possible.");
Console.Write("\nColumn of first matrix and row of second matrix must be same.");
Console.Write("Input elements in the first matrix :\n");
Console.Write("element - [{0}],[{1}] : ",i,j);
arr1[i,j] = Convert.ToInt32(Console.ReadLine());
Console.Write("Input elements in the second matrix :\n");
Console.Write("element - [{0}],[{1}] : ",i,j);
brr1[i,j] = Convert.ToInt32(Console.ReadLine());
Console.Write("\nThe First matrix is :\n");
Console.Write("{0}\t",arr1[i,j]);
Console.Write("\nThe Second matrix is :\n");
Console.Write("{0}\t",brr1[i,j]);
sum=sum+arr1[i,k]*brr1[k,j];
Console.Write("\nThe multiplication of two matrix is : \n");
Console.Write("{0}\t",crr1[i,j]);