Hey guys!
i need help on reversing numbers in descending order.
public class ArrayExercise1 {
public static void main(String[] args) {
int[] values = new int[10];
values[ 0 ] = 1;
values[ 1 ] = 4;
values[ 2 ] = 9;
values[ 3 ] = 16;
values[ 4 ] = 17;
values[ 5 ] = 21;
values[ 6 ] = 25;
values[ 7 ] = 33;
values[ 8 ] = 37;
values[ 9 ] = 40;
for(int count = 0; count < values.length; count++) {
System.out.println(values[ count ]);
}
}
}
Once run, the numbers appear in the right order. But I am stuck on how to reverse them. Some say its easy but i can't figure it out!
Get back to me, thanks