The principal purpose of a flower is the reproduction of the individual and the species. All flowering plants are heterosporous, producing two types of spores. Microspores are produced by meiosis inside anthers while megaspores are produced inside ovules, inside an ovary. In fact, anthers typically consist of four microsporangia and an ovule is an integumented megasporangium. Both types of spores develop into gametophytes inside sporangia. As with all heterosporous plants, the gametophytes also develop inside the spores (are endosporic).
In the majority of species, individual flowers have both functional carpels and stamens. Botanists describe these flowers as being perfect or bisexual and the species as hermaphroditic. Some flowers lack one or the other reproductive organ and called imperfect or unisexual If unisex flowers are found on the same individual plant but in different locations, the species is said to be monoecious. If each type of unisex flower is found only on separate individuals, the plant is dioecious.