title: C++ - Merge two sorted arrays ordered in descending order
body: <p>I have two arrays:</p>
  
  <p>Array 1:</p>
  
  <pre><code>e[0] = 21.145;
  e[1] = 17.152;
  e[2] = 15.541;
  e[3] = 0.095;
  e[4] = -10.515;
  </code></pre>
  
  <p>Array 2:</p>
  
  <pre><code>double *f = new double[5];
  f[0] = 18.458;
  f[1] = 11.542;
  f[2] = 7.152;
  f[3] = 1.243;
  f[4] = -12.758;
  </code></pre>
  
  <p>I need to merge and order these arrays. Here is my code, but it's working for reverse order (as ascending). I want help with descending merge of arrays. I tried replacing operators, but it's not working. Where I mistake?</p>
  
  <pre><code>void mergeArrays(double * arr1, double  * arr2, int n1, int n2, double * arr3){
  
    int i = 0, j = 0, k = 0;
  
    while (i&lt;n1 &amp;&amp; j &lt;n2)
    {
        if (arr1[i] &lt; arr2[j])
            arr3[k++] = arr1[i++];
        else
            arr3[k++] = arr2[j++];
    }
    while (i &lt; n1)
        arr3[k++] = arr1[i++];
  
    while (j &lt; n2)
        arr3[k++] = arr2[j++];    
    }
  </code></pre>