O has oxidation of 2-. This is essential in answering the question.
In CO, the oxidation of C is 2+ since the subscripts were both cancelled out. In CO₂
In CO₂, the oxidation of C is 4+ since O has subscript of 2.
Therefore, the change in the oxidation of carbon is 2. (4-2=2)