how to sort a 1 dimension array?
but it doesnt work. plz help.Code:for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { if(a[i]>a[i+j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } }
how to sort a 1 dimension array?
but it doesnt work. plz help.Code:for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { if(a[i]>a[i+j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } }
if(a[i]>a[i+j])
is your problem. Look at it closely and fix the issue. If you cannot figure it out on your own, come back and we'll help.
Thanks man...i figured it out...thanks again.