What am I doing wrong? the program run but the output isn't in the right order.
#include <stdio.h>
int main () { /*program to ask user to input array values and sort them in ascending order.*/
int n,j,i,temp;
printf ("how many numbers?\n");
scanf ("%d",&n);
int a[n];
for (i=0;i<n;i++){
printf ("enter number");
scanf ("%d",&a[i]);
}
for (i=0;i<n;i++); {
for (j=i+1;j<n;j++){
if (a[i]>a[j]){
temp=a[i];
a[i]=a[j];
a[j]=temp; }
} }
printf("The numbers arranged in ascending order are given below \n");
for (i = 0; i < n; ++i)
printf("%d\n", a[i]);
}
;immediately afterfor (i=0;i<n;i++); {.