My code has a bug. | SoloLearn: Learn to code for FREE!


My code has a bug.

I’m trying To fix the sorting

3/9/2020 2:41:48 AM

Microne mafika

1 Answer

New Answer


In your loops use this, otherwise you get out of range: for(int i=0; i< li.Count -1; i++) { for(int j = 0; j<li.Count -1; j++) and: temp =li[j]; // it should be li[j] li[j]=li[j+1]; li[j+1]=temp;