how multiply two dimensional array aka matrix
<p>I want to know how to multiply 2D arrays (matrices) and show them as a matrix.</p>

<p>The current output is</p>

<pre><code>1 1 1
1 1 1
1 1 1
</code></pre>

<p>which is not the correct result.</p>

<p>The code is below:</p>

<pre><code>    static void Main(string[] args)
    {
        int[,] metrix1 = new int[3, 3] { { 2, 0, 2 }, { 0, 1, 2 }, { 1, 2, 1 } };
        int[,] metrix2 = new int[3, 3] { { 1, 1, 1 }, { 0, 1, 0 }, { 0, 0, 1 } };
        int[,] result = new int[3, 3];

        int m1 =0;
        int m2 =0;

        for (int i = 0; i &lt; 3; i++)
        {
            for (int j = 0; j &lt; 3; j++)
            {
                m1 = metrix1[i, j];

            }
        }

        // metrix 2
            for (int y = 0; y &lt; 3; y++)
            {
                for (int z = 0; z &lt; 3; z++)
                {
                    m2 = metrix2[y, z];
                }
            }
            //m

                for (int a = 0; a &lt; 3; a++)
                    {

                        for (int b = 0; b &lt; 3; b++)
                        {
                        result[a, b] = m1 *m2;
                        Console.Write(result[a, b] );

                        }Console.WriteLine();
                }Console.ReadLine();

                }
            }
        }
</code></pre>