for (int j=0;j<b-1;j++) { for (int c=0;c<b-1;c++) { if (a[c]<a[c+1]) { temp=a[c+1]; a[c+1]=a[c]; a[c]=temp; } } }