Answer
a) $NaBr$
b) $BaO$
c) $MgI_{2}$
d) $Li_{2}O$
Work Step by Step
Before write the formula of ionic compound we have to know the valency of the elements. The no. of electrons lost or gained by the element to get nearest noble gas electronic configuration (stable configuration) is what we called the valency of the element.
Valency of Na = 1.
Valency of Br = 1.
It means Na loses one electron from its valence shell which is gained by Br atom.
Hence, formula of the ionic compound = NaBr.
Similarly, valency of Ba = 2.
Valency of O = 2.
Hence, formula of the ionic compound of this pair = BaO.
But, for Mg & I pair :
Valency of Mg = 2.
Valency of I = 1.
So, it is seen that one 'Mg' atom loses two electrons and one 'I' atom gains one electron. So, we need two 'I' atoms to gain two electrons which is emitted from one Mg atom.
Hence, formula = $MgI_{2}$
Similarly, valency of Li = 1.
valency of O = 2.
Hence, formula = $Li_{2}O$