Selection-sort problem

why one of test cases is giving wrong answer?
please help.

code:
#include
using namespace std;
int main()
{
int n;
cin>>n;
long long int A[100000];
for(int i=0;i<n;i++)
{
cin>>A[i];
}

for(int i=0;i<n-1;i++)
{
	int minindex=i;
	for(int j=i+1;j<n;j++)
	{
		if(A[j]<A[i])
			minindex=j;
	}
	swap(A[i],A[minindex]);
}			

for(int i=0;i<n;i++)
{
	cout<<A[i]<<endl;
}
return 0;

}

@vishalkharwar hey vishal next time please save your code first then share.
change the if condition
if(a[ j ]<a[ minindex ])

Okay sir.
Thank you.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.