why my code is not sorting array
#include <bits/stdc++.h>
using namespace std;
void swap(int *xp, int *yp)
{
int temp = *xp;
*xp = *yp;
*yp = temp;
}
void selection_sort(int a[], int n){
for(int i=0;i<n-1;i++){
int min_indx=i;
for(j=i;j<=n-1;j++){
if(a[j]<a[min_indx]){
min_indx=j;
}
}
}
swap(a[i],a[min_indx]);
}
int main()
{
int i,n,j;
int a[1000];
cout<<“enter size of array”<<endl;
cin>>n;
cout<<“enter the elements of array”<<endl;
for(i=0;i<n;i++){
cin>>a[i];
}
selection_sort(a,n);
for(i=0;i<n;i++){
cout<<a[i];
}
return 0;
}