title: A program to find if the sum of the elements in the middle three rows equals to sum of elements in the middle three columns of matrix print
body: <p>I am trying to write a C program to find if the sum of the elements in the middle three rows equals to sum of elements in the middle three columns of matrix print. So far am able to find the sum of all the columns and rows in the matrix.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  void main()
  {
  
      static int array[10][10];
      int i, j, m, n,sum = 0;
      printf("Enter the order of the matrix\n");
      scanf("%d %d", &amp;m, &amp;n);
      if (m&gt;=5&amp;&amp; n&gt;=5)
      {
          printf("Enter the elements of the matrix\n");
          for (i = 0; i &lt; m; ++i)
          {
               for (j = 0; j &lt; n; ++j)
               {
                    scanf("%d", &amp;array[i][j]);
               }
          }
          for (i = 0; i &lt; m; ++i)
          {
               for (j = 0; j &lt; n; ++j)
               {
                   sum = sum + array[i][j] ;
               }
               printf("Sum of the %d row is = %d\n", i, sum);
               sum = 0;
          }
          sum = 0;
          for (j = 0; j &lt; n; ++j)
          {
              for (i = 0; i &lt; m; ++i)
              {
                   sum = sum + array[i][j];
              }
              printf("Sum of the %d column is = %d\n", j, sum);
              sum = 0;
          }
      }
      else
      {
          printf("The matrix should be a 5 by 5 or bigger");
      }
  } 
  </code></pre>