Robert Mugabe resigned as Zimbabwe’s president on Tuesday a week after the army and his former political allies moved against him, ending his four decades of rule.