Need a starting point on how to sort 5 values!

Given five integers as input, display each in the order entered by the user with the character '>', '<', or '=' in
between each pair of numbers that accurately represents their relationship.
As a starting point, the basic structure you'll want is something similar to
1
2
3
4
5
6
7
if(num > nextNum) {
    //Print a > between the characters
} else if(num == nextNum) {
    //Print a = between the characters
} else {
    //Print a < between the characters
}

You'll want to loop through the values using a for loop, printing each one, then the result of the comparison done as above.

However, as you have not posted any code, it's impossible to know how much you already know or have already done.
Last edited on
Topic archived. No new replies allowed.