First of all. Cancer for your age is rare. Don't worry about that. Rare things are rare and common things are common. Let's focus on the common things.
1. Constipation can be due to many common reasons, most common is low water, low fiber diet, junk food,
thyroid issues,
diabetes.
2. Black stool is usually due to blood loss in stomach which can be due to Ulcer. Sometimes can be due to medicines like iron tablet.
Next Steps
Visit a gastroenterologist for endoscopic evaluation (a tubular scope with camera to look into your stomach to check for Ulcer)
Health Tips
A medical gastroenterologist will also examine you for cancerous growth. So not to worry. Once again I say that cancer for your age is very rare.