Pain below your diaphragm could be of gastric origin ( suggesting gastritis, peptic ulcer diseases, biliary colic
), cardiac origin (angina pectoris
etc), abdominal colic due to indigestion, constipation
etc. Constipation is not able to stool for 3 days. You might be having bloating or over flatulence which signifies dyspepsia/indigestion.
So in any case, for a person of your age and nature of study plus the fact that you sit for long hours to study, i will think you are having dyspepsia + peptic ulcer diseases. These could be handled by you taking protein pump inhibitor such as omeprazole combined with an antacid. Sodium bicarbonate
salt could be of help here. If after taking this for 10-15 days and you still feel the same symptoms, i'll suggest you see a gastroenterologist or your doctor for further investigation and management.
Hope this helps