Question: is ananas masculine or feminine?
Answer: It is masculine, and in plural takes "gli" - gli ananas.