In the end
Incorrect : At the end they found the dead body.
Correct : In the end they found the dead body.
Note: The two phrases “at the end” and ‘in the end' have two different meanings and are not, therefore, interchangeable. “In the end” means "finally” or "at last”, whereas “at the end” means "at the farthest point or part'.
We can say:
The hero and the heroine were united in marriage at the end of the film and in the end they were happy.