title: How do nested for loops work in c#
body: <p>I'm not sure how this code is compiled (using visual studio code just fyi) </p>
  
  <pre><code>int i,j;
  
  for(i=0; i&lt;=6; i++) {
  
      for (j=1; j&lt;=7-i; j++) {
  
          Console.Write("*");
  
      }
      Console.Write("\n"); 
   }
  </code></pre>
  
  <p>My question is when the code is beginning to get compiled, the first <strong> for loop </strong>  is tested and it will be true, then the nested <strong> for loop </strong> is then tested and it will be true so <i>"Console.Write(" * ");</i> is written. But then from here I do not understand what happens or why it happens. Does the compiler then run <i> Console.Write(" \n "); </i> or...</p>