Thomson Reuters Interview Question

it was a coding issue in c language. question about sorting.