title: How to read nested for-loops?
body: <p>I cannot understand what this <code>for-loop</code> does by reading the code. I know how a for-loop works though. By reading this code I literally gain no insight into what the program could be doing.</p>
  
  <p>I'm coming from python to C, if that matters.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main (void)
  {
      int numbers[10] = {1,0,0,0,0,0,0,0,0,0};
      int i, j;
  
      for (j = 0; j &lt; 10; ++j)
          for (i = 0; i &lt; j; ++i)
              numbers[j] += numbers[i];
  
      return 0;
  
  }
  </code></pre>
  
  <p><code>for (j = 0; j &lt; 10; ++j)</code> </p>
  
  <p>This just means iterate through each element of the array. It is easy to understand.</p>
  
  <pre><code>for (i = 0; i &lt; j; ++i)
                  numbers[j] += numbers[i];
  </code></pre>
  
  <p>This is much harder! I think it is because I cannot figure out in my head what <code>j</code> would be equal to. I cannot follow the two loops properly.</p>
  
  <p>I would specifically like to know how I can read and understand this nested for-loop in C.</p>
  
  <p>(I know what this snippet does because I compiled and ran the code.)</p>