Answer
John Quincy Adams became the president in the election of 1824 because no candidate received a majority of the electoral votes, so the decision was made by the House of Representatives, where Adams had more support than his main rival, Andrew Jackson.