Pleasae help with this code. The questions asks to sort the numbers in set from minimum to maximum.
[code]
#include <stdio.h>
int a[100];
int n,i,x,j;
int temp;
int main(int argc, char *argv[])
{
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<=n-1;i++)
{
for(j=i+1;j<=n-2;j++)
{ if(a[i]>a[j])
{ temp=a[i];
a[i]=a[j];
a[j]=temp;}
}}
for(i=0;i<n-1;i++)
printf("%d ",a[i]);
printf("%d\n",a[n-1]);
system("pause");
getchar();
return 0;
}