The method is the same for each compound.
The formula for mass percent is
#color(blue)(bar(ul(|color(white)(a/a) "Mass %" = "mass of element"/"mass of compound" × 100 %color(white)(a/a)|)))" "#
a. #"CH"_4#
#"Mass of 1 molecule of CH"_4 = "12.01 u + 4×1.008 u" = "16.032 u"#
#"Mass of C" = "12.01 u"#
#"% by mass of C "= (12.01 color(red)(cancel(color(black)("u"))))/(16.032 color(red)(cancel(color(black)("u")))) × 100 % = "74.91 %"#
b. #"C"_2"H"_6#
#"Mass of 1 molecule of C"_2"H"_6 = "2×12.01 u + 6×1.008 u" = "24.02 u + 6.048 u" = "30.068 u"#
#"Mass of C" = "24.02 u"#
#"% by mass of C " = (24.02 color(red)(cancel(color(black)("u"))))/(30.068 color(red)(cancel(color(black)("u")))) × 100 % = "79.89 %"#
c. #"C"_2"H"_2#
#"Mass of 1 molecule of C"_2"H"_2 = "2×12.01 u + 2×1.008 u" = "24.02 u + 2.016 u" = "24.036 u"#
#"Mass of C" = "24.02 u"#
#"% by mass of C " = (24.02 color(red)(cancel(color(black)("u"))))/(26.036 color(red)(cancel(color(black)("u")))) × 100 % = "92.26 %"#
d. #"C"_2"H"_5"Cl"#
#"Mass of 1 molecule of C"_2"H"_5"Cl" = "2×12.01 u + 5×1.008 u + 35.45 u" = "24.02 u + 2.016 u + 35.45 u" = "64.51 u"#
#"Mass of C" = "24.02 u"#
#"% by mass of C " = (24.02 color(red)(cancel(color(black)("u"))))/(64.51 color(red)(cancel(color(black)("u")))) × 100 % = "37.23 %"#