Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
An important distinction between a president and a prime minister overlooked by many answers below is that a president is a head of state, while a prime minister is a head of government. A prime minister is always has some form of higher head of state above them, even if the head of state is largely ceremonial (i.e. constitutional monarchies and parliamentary systems). A monarch is always some such head of state, with or without actual political power. A president is also always head of state, but variously is (the US) or is not (France, Germany) the head of government also.