Why this function is not working here? It's not sorting on output. Suppose if I enter 1 4 2 the output is