Descending Selection Sort function

Hello, again. I am having some difficulties changing this selectionsort function from ascending to descending. Any help with this would great!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
void sortScores(int arr[],int size)
{
	int   startScan, minIndex, minValue;

	for (startScan = 0; startScan<(size - 1); startScan++)
	{
		minIndex = startScan;
		minValue = arr[startScan];
		for (int index = startScan + 1; index < size; index++)
		{
			if (arr[index] <  minValue)
			{
				minValue = arr[index];
				minIndex = index;
			}
		}
		arr[minIndex] = arr[startScan];
		arr[startScan] = minValue;
	}
 }
There is a single expression here that is dependent on the order of the values in the sequence you are sorting. I imagine if you changed that expression to the "opposite" of what it is, you'd reverse the sorted sequence.
I could have sworn I tried that first LOL. It worked!!! thanks so much.
I have another question, hopefully you can help me.

How do I get the sorted scores to show up on a numbered list:

example:

Top Scores:
1.
2.
3.
4.
5.
Registered users can post here. Sign in or register to post.