The percentage by mass is determined by 1. multiplying each elemental mass by the number of atoms in a molecule, 2. adding the result, and then dividing the individual masses by the total mass.
1. acetylene has the empirical formula C2H2, the elemental mass of Carbon is 12, and Hydrogen is 1. So (12x2) + (1x2) = 26. We then divide the elemental masses by the molecular mass. So, 24 / 26 = 92.308% for Carbon
2. ascorbic acid has the empirical formula C6H8O6, the elemental mass of Carbon is 12, Hydrogen is 1, and Oxygen is 16. So, (12x6) + (1x8) + (16x6) = 176. So 8/176 = 4.54% for Hydrogen
The other problems will be solved in the same way.