Now I realise that this probably a homework assignment - as such I (nor others I think) am not going to write it for you. You won't learn anything that way.
We can help you if you provide at the least some thoughts on how you are going to do it.
The assignment is well setout and provides half the algorithm.
Look at what you need to do:
1. How to open and read text files
2. How to put info into an array
3. How to sort things
I am guessing that your tutor/ lecturer has already given you all quite a bit of info already, and you have a text book on the C language. The C Language by Kernigan & Richie is one of the best books. You also have Google. There is a lot of stuff on this website.
BTW I am not a tutor or anything - I just like to help. So do a little bit of work yourself, then we can help from there.