your symptoms seem to be of IBS irritable bowel syndrome
which has alternating constipation
you need to visit a colorectal surgeon & a gastroenterologist and get your stools and colonoscopy done along with rectal examination
you can be cured by medicines only if there are no abnormalities in the above tests.
wish you good health
dr pravin gore - proctologist
, colorectal surgeon Mumbai