The correct option is D Endoscopy
Gastric ulcer is a break in the lining of the stomach. The best way to investigate it is by the gastroscopy. Gastroscopy or upper gastrointestinal endoscopy involves the use of a thin, flexible lighted tube, called endoscope, which is eased through the mouth and down the throat to give a direct view of the inside of the esophagus, stomach and duodenum.
Thus, the correct answer is option (D), 'Endoscopy'.