By the equation #C+1/2O_2->CO#
If Whole 12g crbon is converted to #CO# then total amount of CO produced would be 28g and the oxygen consumed would be 16g.So residual 4g should go to transform #COto CO_2# on further oxidation of #CO# by following reaction.
#CO+1/2O_2->CO_2#
So residual 4g Oxygen will produce #44/16xx4=11g# #CO_2# and thereby consuming #28/16xx4=7g# #CO# leaving #(28-7)=21g# #CO#.
So the ratio of #CO and CO_2# produced on full consumption of given 12g Carbon and 20g Oxgen would be #21:11#
NB
Calculation may be done in another way
First the whole 20g oxygen is consumed forming #CO_2# first following equation #C+O_2->CO_2#. For this 2og Oxygen will produce #44/32xx20g=27.5 g# #CO_2# and this will consume
#12/32xx20g=7.5g# #C#. The residual Carbon #(12-7.5)g=4.5g# will now reduce #CO_2toCO # following the equation
#CO_2+C->2CO#. So residual #4.5g# carbon will produce#(2xx28)/12xx4.5g=21g CO# consuming #44/12xx4.5g=16.5g# #CO_2#.
Thus the final amount of #CO_2# in the mixture becomes
#(27.5-16.5)=11g#
So the ratio of #CO and CO_2# produced on full consumption of given 12g Carbon and 20g Oxgen would be #21:11#
Finally by ratio proportion
#"Compound"" "" "Amount" "" "Carbon" "" ""Oxygen"#
#CO" "" "" "" "" "28g" "" "" "" "12g" " """ "" "16g#
#CO_2" "" "" "" "" "44g" "" "" "" "12g" " """ "" "16g#
#CO" "" "" "" "" "xg" "" "" "" "(12xx x)/28g" " """ "(16xx x)/28g#
#CO_2" "" "" "" "" "yg" "" "" "" "(12xx y)/44g" " """ "(32xx y)/44g#
By the problem
#((12xx x)/28+(12xx y)/44)/((16xx x)/28+(32xx y)/44)=12/20#
#=>x/y=21/11#