Pregunta de entrevista de Thomson Reuters

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