title: C : 0 & 1 combinations using recursion
body: <p>I want to list combinations of o &amp; 1 recursively using c depending on variables number (number)</p>
  
  <p>the output I want is </p>
  
  <pre><code>000
  001
  010
  011
  100
  101
  110
  111
  </code></pre>
  
  <p>I've tried many algorithms the last one is :</p>
  
  <pre><code>void permute(unsigned number)    {
  
      if(number == 0) {
          printf("\n");
          return;
      }
  
      permute(number - 1);
          printf("0");
      permute(number - 1);
          printf("1");
  
  
  }   //permute ends here
  
  
  void permuteN(unsigned number) {
  
      unsigned i;
  
      for(i = 0; i &lt; number + 1; i++){
          permute(i);
      }
  }   //permuteN ends here
  </code></pre>
  
  <p>I think it gives me the answer but not ordered because I don't know where to put \n;</p>
  
  <p>need your help!</p>