for j da 1 N-1 for i da 1 a N-1 if a[i]>a[i+1] temp=a[i]; a[i]=a[i+1]; a[i+1]=temp; fine if fine for fine for