I won't give you full solution but some hints
1. Create a structure that will have name (stored as string) and roll number (stored as int)
2. Create a link list.
3. Inside the main program, iterate to take inputs from user name and roll number
4. Keep on adding these to new structure and add the structure to link list
5. Once user input is done
6. Iterate over the link list, and keep on getting the roll number. Store in array.
7. Write an algorithm to sort this number and get the indices in array in increasing order of roll number
8. With the indices you know in which order the structure in link list is stored. Query from link list these structures as per sorted indices and display to user.
Give it a try, you will learn something. Ready made solution wont teach you anything