Answer:
A. Generally ionic compounds are formed metal and non metal elements since they forms opposite charged ions due to difference in their Electronegativity values.
NaCl, MgCl2, Ca(OH)2 etc are ionic compounds.
B. Generally transition elements (D elements) forms cations with different charges or simply they exist in different oxidation states due to availability of empty d orbitals.
Examples are Iron exsits as Fe+2 and Fe+3
Mn exists as Mn+2 , Mn+4, Mn+6 ,Mn+7 etc.