title: Recursive C Function - Print Ascending Order
body: <p>I'm trying to implement a code that recursively calls itself and prints the given digits in ascending order, i.e. if the number is 5, then the function will print 1 2 3 4 5. I cannot use loops in any way!</p>
  
  <pre><code>void print_ascending(int n)
  {
     int i = 1;
  
     if(i &lt; n)
     {
        printf("%d", i);
  
        i++;
  
        print_ascending(n);
     }
  }
  </code></pre>
  
  <p>Of course, the problem with this code is it will re-initialize the variable i to 1 every single time and infinitely loop to print 1. </p>
  
  <p>There are also no outside global variables or outside functions allowed!</p>