Answer:
When burning magnesium ribbon is reacted with Carbon dioxide and hydrogen gas. It forms white powdered MgO and black substance carbon.
Reaction:
while burning
The formation of black spot of carbon is only from carbon dioxide. It can be also shown by reaction.
while heating
To prove CO content carbon element for all CO is burnt in excess to get Carbon dioxide and proceed as above.
while heating