Cognizant interview question

Sorting in both orders and reverse number code in c language