Concentrated sulphuric acid (conc. H2SO4) is a strong dehydrating agent. When conc. H2SO4 is added to sugar (i.e. saccharide like sucrose, C12H22O11), it removes the water molecules as shown in the reaction below. The dehydration of sucrose is an exothermic reaction. The water released during dehydration dilutes the acid, which is also an exothermic process. Due to heat generated, sugar is charred and carbon mass appears as black solid.