CO : CO₂ ratio when given amounts of carbon and oxygen react with each other By the reaction of carbon and oxygen a mixture of $\ce{CO}$ and $\ce{CO2}$ is obtained. What is the composition of the mixture by mass obtained when 20 grams of $\ce{O2}$ reacts with 12 grams of carbon?


I wrote the equation as 

$$\ce{4C + 3O2 -&gt; 2CO + 2CO2}$$ 

and identified $\ce{O2}$ as the limiting reagent then the masses of $\ce{CO}$ formed will be 11.66 grams and mass of $\ce{CO2}$ formed will be 18.33 grams, which gives the ratio as 7:11, but the answer is given as 21:11.

Can somebody please tell me where am I going wrong?
You should have written:

$$\ce{C + O2 -&gt; CO2}$$ 

and 

$$\ce{C + \frac{1}{2}O2 -&gt; CO}$$  

Then you should have determined what fraction of the carbon reacts by by the first reaction and what fraction of the carbon reacts by the second reaction.