explain how the mass of carbon in an amount of carbon dioxide can be determined. Please help ASAP!!! :(

C = 12 g/mol

O = 16 g/mol
CO2 = 12 + 16 + 16 = 44 g/mol
so mass carbon = (12/44)* mass of CO2