0

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

Edited by Reverend Jim: Fixed formatting

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by ramborambo
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.