Sulphuric acid act as a dehydrating agent when added to sugar.
Here, Sulphuric acid does not react with sugar, in fact, it dehydrates the sugar molecule by removing the Hydrogen and Oxygen atom to form a water molecule (in the form of steam) as the water gets vapourised due to a lot of heat released in the reaction.
Since the reaction is a highly exothermic reaction a black mass of Carbon is left behind.