title: Recursive Number Printing
body: <p>If the number 5 is given to us, it needs to be printed out on the console like 1, 2, 3, 4, 5. This needs to be done recursively. (Java preferably)</p>
  
  <p>In case anyone is wondering these are not homework questions. I am practicing for my midterm a week from now.</p>
  
  <p>Sorry about not posting my work. I was doing something like the below: but getting confused with where to print the rest of the number, and how to stop recursively calling the method with (n - 1). Jacob with his post helped me out. Thanks to everyone who helped.</p>
  
  <pre><code>public void writeNums(int n) {
      if (n &lt; 1)
          throw new IllegalArgumentException();
      if (n == 1) {
          System.out.print("1, ");
      }
      writeNums(n - 1);
  </code></pre>