Madagascar is part of african, but when looking at the world map you'll see and area that shows that the madagascar island broke out of the african continent millions of years back.
Madagascar is not a part of Africa this is because originally part of the ancient Gondwana was form in two steps; the Island together with India pull away from Africa 150 million Years ago stretching and thinning the crust on islands west coast before it finally snaps off
Madagascar is the world's fifth largest island, situated in the Indian Ocean off the coast of southern Africa. Despite considerable natural resources, however, its population of about 28 million (2020) has one of the world's highest poverty rates.