How do you Find the mass (in g) of Carbon in 2.980 g Carbon dioxide?

I saw the question asked before but couldn't find a solution.

To find the mass of carbon in carbon dioxide, we need to use the molar masses of carbon and carbon dioxide.

The first step is to determine the molar mass of carbon dioxide (CO2). Carbon has an atomic mass of approximately 12.01 g/mol, while oxygen has an atomic mass of approximately 16.00 g/mol. Carbon dioxide contains one carbon atom and two oxygen atoms.

The molar mass of CO2 is calculated as follows:
Molar mass of CO2 = (1 * molar mass of carbon) + (2 * molar mass of oxygen)
Molar mass of CO2 = (1 * 12.01 g/mol) + (2 * 16.00 g/mol)
Molar mass of CO2 = 12.01 g/mol + 32.00 g/mol
Molar mass of CO2 = 44.01 g/mol

Next, we can use the molar mass ratio to find the mass of carbon in 2.980 g of carbon dioxide. The molar mass ratio compares the molar masses of the two substances.

Mass of carbon = (molar mass of carbon / molar mass of CO2) * mass of carbon dioxide

Substituting the given values:
Mass of carbon = (12.01 g/mol / 44.01 g/mol) * 2.980 g
Mass of carbon = 0.273 g

Therefore, the mass of carbon in 2.980 g of carbon dioxide is approximately 0.273 g.