To avoid Delhi belly, drink only bottled water from good sources, brush your teeth with bottled water, keep your mouth shut in the shower/bath, eat only hot, well cooked food*, and if eating fruit or vegetables avoid anything that you can't peel yourself and rinse with bottled water. I've hosted plenty of people in India who easily avoid getting sick if following the basic rules above and the basic rules about washing hands and not touching the face.
I wouldn't generally recommend taking anti-malaria or anti-dengue medication for visits to India; but, depending on where you'll be in India, my recommendation would vary.
*Edit (courtesy of amigo alert): Mistakenly put "foot in mouth" where it should have been "food in mouth". Talk about putting foot in mouth. And given my run-on, grammatically lousy sentence, I need to put a sock in my own mouth today.