Let's find the Molar mass of Carbon =12.
Molar mass of Hydrogen =1.
Molar mass of Oxygen =16.
Mass of CH2O=12+2(1)+16=30.
Molecular weight of compound given is 180 .
So, the molecular weight is 30180=6. ⇒ Molecular formula of compound is C6H12O6.