David Cameron has resigned as British Prime Minister, shortly after it was announced that his country had voted to leave the European Union.