title: Number of nested loops at runtime
body: <p>I am trying to output all the possible unique integer combinations from 1 to max for a set number of integers.  So for 3 integers and a max of 4 I would get:</p>
  
  <p>123
  124
  134
  234</p>
  
  <p>I am doing this with nested for loops but I want to allow the user to input the number of integers at runtime.  right now I have </p>
  
  <pre><code>if(numInts &gt;6);
  for(int x = 1; x &lt; max; x++);
  if(numInts &gt;5);
  for(int y = 1; y &lt; max; y++);
  ...
  </code></pre>
  
  <p>Is there a way to clean this up so I don't have to write out each possible integer for loop.</p>
  
  <p>PS: I know the code above will not output the requested output.  This is for a programing competition so I am not asking for code solutions just the idea that would make this possible.  </p>