title: Get the unknown length of number from input
body: <p>I am doing a assignment which requires the input of a list of numbers and get the output when I press <kbd>Enter</kbd> on the keyboard. This is the code I am trying the use to get the list of numbers when I enter, but it doesn't work:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(){
      int arra[100];
      int i ;
      int j = -1;
      while (scanf("%d",&amp;i) != 1){ 
          arra[++j] = i;
      }
      printf("\n");
      int k;
      for(k = 0; k &lt; j; k++){
          printf("%d",arra[k]);
      }
      return 0;
  }
  </code></pre>
  
  <p>I want to print the elements of <code>arra</code>.</p>