CJCoding With Joseph
15free / daySign inCreate account

qsort Scores From High to Low

Write a qsort comparator that sorts DESCENDING (largest first), then in main read an integer n (at most 64), read n scores, sort them with qsort, and print them on one line separated by single spaces with no trailing space.

For the input:

6
42 7 19 7 88 3

the output is exactly what is shown in Expected Output.

The line ends with a newline.

Expected Output:

88 42 19 7 7 3

= newline. The output ends with a newline — print one after the last line.

Hints4 available
Topics:
Pointers
📥 Auto-Input:
6\n42 7 19 7 88 3\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.