title: Incrementing a for loop upward in C
body: <p>I am hoping to mimic a Python for loop with the range() function in C. I'd like to accomplish a task an increasing number of times each loop until I reach the value of a given variable, in this case 5 (for the variable h). Here it is in Python:</p>
  <pre><code>x = 5
  y = 0
  while x &gt; y:
      for i in range(y+1):
          print(&quot;@&quot;,end='') 
      print('')
      y+=1
  
  Output: 
  @
  @@
  @@@
  @@@@
  @@@@@
  </code></pre>
  <p>I was able to accomplish the opposite (executing something a decreasing number of times) in C, as below:</p>
  <pre><code>{
      int h = 5;
      
      while (h &gt; 0)
      {
          for (int i = 0; i &lt; h; i++)
          {
              printf(&quot;@&quot;);
          }
          printf(&quot;\n&quot;);
          h--;
      }
  }
  
  Output:
  @@@@@
  @@@@
  @@@
  @@
  @
  </code></pre>
  <p>When I've attempted the top version in C, with the increasing number of executions, I run into the problem of not knowing how to control the various incrementing and decrementing variables.</p>