c# method to sort array without using any loop
<p>how can we write c-sharp method or java method to sort an array without using any loop, i tried following but not working correctly.</p>

<pre><code>public static void sortArray(int[] array)
{
        int index = 0;
        int temp = 0;
        if (index &lt; array.Length - 1)
        {
            if (array[index] &gt; array[index + 1])
            {
                temp = array[index];
                array[index] = array[index + 1];
                array[index + 1] = temp;
            }



            index++;
            sortArray(array, index);

        }


    }
</code></pre>