The empirical formula for a compound is KClO3
Explanation
find the moles of each element
moles = % composition/molar mass
molar mass of of potassium =39g/mol ,chlorine = 35.5 g/mol, oxygen =16 g/mol
moles of potassium = 31.9 / 39 = 0.818 moles
moles of chlorine = 28.9/35.5 = 0.814 moles
moles of oxygen = 39.2/ 16 = 2.45 moles
find the mole ratio by dividing with the smallest mole = 0.814 moles
potassium = 0.818/0.814 =1
chlorine = 0.814/0.814 = 1
oxygen = 2.45 /0.814 =3
the empirical formula is therefore = KClO3