#include
using namespace std;
int sel_sort(int a[],int n)
{
int min_index;
for(int i = 0;i<n-1;i++)
{min_index=i;
for(int j=i;i<=n-1;j++)
{if(a[min_index]>a[j])
{min_index=j;
}
}swap(a[i],a[min_index]);
}
}
int main(){
int n;
cout<<“enter the size of the array:”<<endl;
cin>>n;
int a[1000];
for(int i =0;i<n;i++){cin>>a[i];
}
sel_sort(a,n);
cout<<“the array is:”<<endl;
for(int i=0;i<n;i++)
{cout<<a[i]<<endl;
}
}
doesnt execute