title: Reading an array of integers and printing them out
body: <p>I'm learning C on my own and doing a few exercises.<br/> The following code reads in an
  array of integers from the user. The integers are printed out when the user types in a "0" or when the array is filled. Now the problem is the output.<br/> When I type in "0" after I have typed in 3 digits e.g. 1 2 3 the output is the following: 1 2 3 -858993460 -858993460. I am not sure why I get the value "-858993460" but I have already found a solution to avoid it. Now my question is what the values mean and if there is a smarter solution than mine which is presented below as comments.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #define arraylength 5
  
  
  int main ()
  
  {
      //const int arraylength = 21; //alternative possibility to declare a constant
      int input [arraylength] ;
      int temp = 0;
      //int imax = 0;
  
      printf("Please type in a your digits: ");
      for (int i = 0; i &lt; arraylength; i++)
      {
          scanf("%d", &amp;temp);
          if ( temp !=0)
          {
              input[i]= temp;
              //imax= i;
          }
          else
          {
              //imax= i;
              break;
          }
  
          if (i &lt; arraylength-1)
               printf("Next: ");
  
      }
  
      for (int i =0; i &lt; arraylength; i++ )   // switch arraylength with imax
      {
              printf("%d", input[i]);
      }
  
  
  
      getchar();
      getchar();
      getchar();
  
  }
  </code></pre>