title: How can I do this again? in C
body: <pre><code>#define G 10
  int main(){
  int grid[G][G],c,x;
  for(c=1;c&lt;=5;c++){
      for(x=1;x&lt;=5;x++){
          if(c+x&lt;=5)
              grid[c][x]=+1;
          else if(c+x&gt;=7)
              grid[c][x]=-1;
          else
              grid[c][x]=0;
  
          printf("%2d\t ",grid[c][x]);
      }
      printf("\n");
  }
  getch();
  return 0;
  }
  </code></pre>
  
  <p>its output is 
  <img src="https://i.stack.imgur.com/E1DV8.png" alt="enter image description here">
  Which is what I really wanted to do but now I need to make it look like
  <img src="https://i.stack.imgur.com/l9UD8.png" alt="enter image description here"></p>
  
  <p>and now I don't have any idea on how to do it, it's hurting my head now </p>