Corals themselves are heterotrophs. However, some species (not all) form a symbiotic relationship with dinoflagellate algae. These algae colonize the corals' bodies and carry out photosynthesis, providing the corals with food in exchange for protection.