Final answer:
NH₄Cl (option 2) is the compound that contains both ionic and covalent bonds. The ammonium ion forms an ionic bond with the chloride ion, and within the ammonium ion, nitrogen and hydrogen atoms are held together by covalent bonds.
Step-by-step explanation:
The compound that contains both ionic and covalent bonds from the options provided is NH₄Cl (option 2). Ammonium chloride, NH₄Cl, is an example of such a compound. In NH₄Cl, the ammonium ion (NH₄⁺) forms an ionic bond with the chloride ion (Cl⁻). Within the ammonium ion itself, there are covalent bonds holding the nitrogen and hydrogen atoms together. None of the other options (HCl, NaCl, CCl₄) contain both ionic and covalent bonds; they contain either ionic or covalent bonds exclusively.