The correct option is C AB2
In a neutral molecule, the sum of bonding valence electrons on each element must be equal to the total number of valence electrons in the entire compound. So, the total charge on the cation has to be equal to the total charge on anion. Let x be the number of A atoms with charge C1 and y be the number of B atoms with charge C2. In ionic compounds, valency gives indication of charge on ion.
So, C1 = 4 since A loses 4 electrons and C2 = 2 as B gains 2 electrons.
x×C1=y×C2
4×x=2×y
xy=24=12
∴AB2