Ask someone for gum. (They are most likely to give you gum than any other food you ask for. )
Tell the teacher about your empty stomach. (She might have snacks like crackers. )
Bring mints or water to school on exam day. (Those two items will get you less amount of trouble. I'm not sure if your school allows gum so eat it secretly.)
Massage your stomach.
Calm yourself down.
Don't put too much pressure on your brain because it will make you more hungry. (Try to relax because you have about 2 hours for the exam. It should take you about 1 hour and 20 minutes.)