Answer:
The president and vice president of the US are elected by indirect election. The candidates do not cast direct votes for president and vice president, they vote for members of the electors. The electors then cast their votes. The candidates which gets maximum votes is elected to the office.
Earlier as the provisions established by Article Two, the electors used to cast two votes for two different candidates. Candidate who got maximum number of vote became the president and the president with less votes than the winner became vice president.