David Cameron has announced his resignation as Prime Minister of the U.K. after the shock victory for the campaign to leave the EU.