title: Moving all zeros to the begining of array
body: <p>I'm trying to write a function which moves all numbers from begining of array to the end of it. order should not change.</p>
  
  <p>for example i have this array:</p>
  
  <p>1, 2, 3, 4, 5, 0, 0, 0, 0</p>
  
  <p>i want to change it to:</p>
  
  <p>0, 0, 0, 0, 1, 2, 3, 4, 5</p>
  
  <p>I already wrote a version of it but it can't keep the order. (array[] is original and a[] is sorted)</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define SIZE_MAX 20
  
  int main()
  {
      int array[SIZE_MAX] = {1, 2, 3, 4, 5, 0, 0, 0, 0};
      int a[SIZE_MAX];
      int i;
      int p = 0;
  
      for (i = SIZE_MAX-1; i &gt;= 0; i--, p++)
      {
          a[i] = array[p];
      }
  
      for (i = 0; i &lt; SIZE_MAX; i++)
      {
          printf("%d", a[i]);
      }
  }
  </code></pre>