How do I make my program take 5 float values from a user and sort them in increasing order?
<p>What I exactly want my program to do is ask user to enter 5 values, output those 5 values to the screen, sort them from lowest to highest and output the sorted order to the screen.
I have the following code: </p>

<pre><code>void sort(float[], int);

int main()
{

    const int SIZE = 5;
    float a[SIZE];

    cout &lt;&lt; "Enter " &lt;&lt; SIZE &lt;&lt; "numbers:\n";

    for(int i = 0; i&lt;SIZE; i++);
    cin &gt;&gt; a[i];
    sort(a,5);
    cout &lt;&lt; "In sorted order: ";
}

void sort (float a[], int n)
{
    for (int i=1; i &lt; n; i++)
        for (int j=0; j &lt; n-i; j++)
            if (a[j] &gt; a[j+1]) swap (a[j], a[j+1]);
}
</code></pre>
