title: finding max sum of matrix rows and columns, these are 2 codes i got 1 is working but the other is not,though the array initialization are the same
body: <p>in code 1,the array run time initialization was working fine but in code 2 it isnt         though both the codes are nearly same</p>
  
  <h3>Code 1:</h3>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main()
  {
      int n;
      scanf("%d",&amp;n);
      int A[n][n],i,j;
      for(i=0;i&lt;n;i++)
      {
          for(j=0;j&lt;n;j++)
              scanf("%d",&amp;A[i][j]);
      }
      int sum=0, newsum=0;
      for(i=0;i&lt;n;i++)
      {
          newsum = 0;
          for(j=0;j&lt;n;j++)
          {  
              newsum = newsum + A[i][j];
          }
          if(sum &lt; newsum)
          {
              sum = newsum;
          }
      }
      return 0;
  }
  </code></pre>
  
  <h3>Code 2:</h3>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main()
  {
      int dim,i,j,k,h=0;
      scanf("%d",k);
      int array[k][k];
      int max[2k+2]={0};
  
      for(i=0;i&lt;k;i++)
      {
          for(j=0;j&lt;k;j++)
          {
              scanf("%d",&amp;array[i][j]);
          }
      }
      //rows
      h=max[0];
      for(i=0;i&lt;k;i++)
      {
          for(j=0;j&lt;k;j++)
          {
              max[i]+=array[i][j];
  
          }
          if(max[i]&gt;=h)
          {
              h=max[i];
          }   
      }
      //columns 
      for(j=0;j&lt;k;j++)
      {
          for(i=0;i&lt;k;i++)
          {
              max[j+k]+=array[i][j];
          }
          if(max[j+k]&gt;=h)
          {
              h=max[j+k];
          }
  
      }  
      //diagonal_1
      for(i,j=0;j&lt;k &amp;&amp; i&lt;k;j++,i++) 
      {
          max[2k]+=array[i][j];
      }
      for(i=0,j=k-1;j&gt;=0&amp;&amp;i&lt;k;j--,i++) 
      { 
          max[2k+1]+=array[i][j];
      }          
      if(max[2k]&gt;=max[2k+1])
          max[2k]=max[2k]; 
      else
          max[2k]=max[2k+1];
  
      if(max[2k]&gt;=h)
          printf("%d",max[2k]);
      else
          printf("%d",h);   
  
      return 0;
  }        
  </code></pre>
  
  <p>The errors that occurred are:</p>
  
  <pre><code>Program: In function 'main':
  Program:11:9: error: fixed-point types not supported for this target
  Program:48:6: warning: left-hand operand of comma expression has no effect[-       
  Program:50:13: error: fixed-point types not supported for this target
  Program:54:9: error: fixed-point types not supported for this  target    
  Program:56:8: error: fixed-point types not supported for this target
  Program:56:17: error: fixed-point types not supported for this target    
  Program:57:5: error: fixed-point types not supported for this target 
  Program:57:13: error: fixed-point types not supported for this target
  Program:59:5: error: fixed-point types not supported for this target    
  Program:59:13: error: fixed-point types not supported for this target 
  Program:61:8: error: fixed-point types not supported for this target
  Program:62:17: error: fixed-point types not supported for this target
  Program:11:5: warning: unused variable 'max' [-Wunused-variable]
  </code></pre>