problem in coding
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3794856/sorting-in-arrays">Sorting in arrays</a>  </p>
</blockquote>



<pre><code>int A[5]={1,5,3,2,4};
for(int i=0;i&lt;5;i++){
    for(int j=0;j&lt;5;j++){
        if(A[j]&gt;A[j+1])
        {
           int t=A[j];
           A[j]=A[j+1];
           A[j+1]=t;
        } 
    }
}
for(i=0;i&lt;5;i++)
   cout&lt;&lt;A[i];
</code></pre>

<p>The desired output must be 1,2,3,4,5
but my output is 0,1,2,3,4.
What's the problem in my code?</p>
