So I am not sure why this is becoming so hard for me, but I need to sort high to low and low to high.
For high to low I have:
int a, b; int temp; int
Let me know if this works:
public class prog1 { public static void main (String args[]){ int a[] = {1,22,5,16,7,9,12,16,18,30}; for(int b=0; b<=a.length;b++){ for(int c=0; c<=a.length-2;c++){ if(a[c]>a[c+1]){ int temp=0; temp=a[c]; a[c]=a[c+1]; a[c+1]=temp; } } } for(int b=0;b