title: How to concat integer and string inside recursive function in C
body: <p>guys, I want to make a program to generate all combination elements. for example if user input (n) = 3, so the output must be like this : </p>
  
  <pre><code>1
  12
  123
  13
  2
  23
  3
  </code></pre>
  
  <p>I have a problem to concat integer and string inside recursive function..</p>
  
  <p>Code :</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void rekursif(int m, int n, char angka[100]){
      int i;
      for(i=m; i&lt;=n; i++){
          sprintf(angka, "%s %d", angka, i);
          printf("%s \n", angka);
          rekursif(i+1,n,angka);
      }
  }
  
  int main(){
      rekursif(1,5,"");
      return 0;
  }
  </code></pre>
  
  <p>when I run the program, command prompt is not responding. I guess, the problem is in concation ( sprintf(angka, "%s %d", angka, i); ) 
  please help me to solve this problem. thank you :)</p>