Ionic bonding:
Equation shows, 'Sodium atom (Na) plus Chlorine atom (Cl) gives Sodium ion (Na plus ) Chloride ion (Cl minus). The sodium atom loses one electron and becomes positively charged sodium ion. The chloride ion gains on electron and become negatively charged chloride ion.
Covalent bonding:
Two hydrogen atoms share two electrons each with one oxygen atom.