Regarding testcase fail


sir this program showing me test case fail can you please check

Check for
input:
4
-20
-10
-30
-50
You will know your mistake.

sir can you tell my mistake

Do this

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

sir its showing me 2 test case fail

for(int j=0;j<n-i-1;j++){
update this

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.