Dear student
let x be the no. of oxygen and 2x be the no. of hydrogen,
40% of the compound is carbon, hence its mass will be
40% of 60 = 24
Hence
16x+ 1(2x) + 24 = 60
x=2
Hence the formula of compund is CH3COOH and it's empirical formula is CH2O
Regards