Edin Dzeko scored Manchester City's 100th goal of the season as they won 4-2 at home to Cardiff in the Premier League.