A compound is composed of a cation that is considered as the positively charged ion and an anion that is considered on the other hand as the negatively charged ion. In this case, when a compound is formed, an exchange of numbers reflected on the subscript takes place. The compound formed thus is X2Y