This is my code

#include
using namespace std;
int main() {
int n;
cin>>n;
int A[n];
for(int i=0;i<n;i++)
{
cin>>A[i];
}
int minindex=0;
for(int i=0;i<n-1;i++)
{
minindex = i;
for(int j=i+1;j<n;j++)
{
if(A[j]<A[minindex])
{
minindex = j;
}
j++;
}
swap(A[i],A[minindex]);
}
for(int i=0;i<n;i++)
{
cout<<A[i]<<endl;
}
return 0;
}

can you please check what’s wrong with this code

@Saranshj10 hey saransh i will request you to always upload the saved code link of the ide. the only problem with your code is don’t increment j++

thank you sir the issue is resolved