When you hiccup, your diaphragm convulses, causing you to momentarily gulp air. Within 35 milliseconds, the glottis (the opening at the top of the air passage) slams shut, creating that distinctive “hic” sound. Sometimes, you can suppress the hiccup right away. But if you hiccup more than seven times, be prepared for a long ride. Once you start hiccupping, the average person hiccups 63 times. And currently, the all-time consecutive hiccup record is 57 years! Hiccups are typically caused by the swelling of the stomach, which will happen if you eat too much, drink carbonated beverages, or swallow air.
Why do we hiccup? Science offers no clear answer. Unlike gagging, sneezing, etc., hiccups serve no known useful function. Some hypothesize that hiccups “may represent a vestigial remnant of a primitive reflex whose functional or behavioral significance is now lost,” as one researcher put it.
Which brings up the question of hiccup cures, many of which have been suggested. Home remedies include holding your breath, induced sneezing, breathing into a bag, drinking water while covering your ears, pulling your tongue, pressing on the eyeballs, sudden fright, or even eating dry granulated sugar. And, a TeamSnap user recommends eating pineapple, saying the acid does something to the diaphragm and they are gone in no time.
(Source: The Straight Dope)