Pregunta de entrevista de Cognizant

How to sort using for loop in C++