title: adding, subtracting, multiplying matrices in functions
body: <pre><code>#include&lt;iostream&gt;
  
  using namespace std;
  
  main()
  {
  int m, n, c, d, first[10][10], second[10][10], sum[10][10];
  
  cout &lt;&lt; "Enter the number of rows and columns of matrix ";
  cin &gt;&gt; m &gt;&gt; n;
  cout &lt;&lt; "Enter the elements of first matrix\n";
  
  for (  c = 0 ; c &lt; m ; c++ )
    for ( d = 0 ; d &lt; n ; d++ )
       cin &gt;&gt; first[c][d];
  
  cout &lt;&lt; "Enter the elements of second matrix\n";
  
  for ( c = 0 ; c &lt; m ;c++ )
    for ( d = 0 ; d &lt; n ; d++ )
          cin &gt;&gt; second[c][d];
  
  for ( c = 0 ; c &lt; m ; c++ )
    for ( d = 0 ; d &lt; n ; d++ )
       sum[c][d] = first[c][d] + second[c][d];
  
  cout &lt;&lt; "Sum of entered matrices:-\n";
  
  for ( c = 0 ; c &lt; m ; c++ )
  {
    for ( d = 0 ; d &lt; n ; d++ )
       cout &lt;&lt; sum[c][d] &lt;&lt; "\t";
  
    cout &lt;&lt; endl;
  }
  
  return 0;
  }
  </code></pre>
  
  <p>Hi guys so I found this source code online to add two matrices but I have a few questions to ask:
  why was first[10][10], second[10][10], sum[10][10] declared to have a size 10 array?</p>
  
  <p>Also, to make this a subtraction I simply just change the sign and few other things right?</p>
  
  <p>How about multiplication? Any explanation on that? Thanks guys.</p>