Final answer:
Among the given options, MgF2 is an ionic compound.
Step-by-step explanation:
An ionic compound is formed between a metal and a nonmetal. Among the options given, H2O and C2H4 are covalent compounds because they contain only nonmetal elements. NH3 is also a covalent compound because it contains only nonmetals. On the other hand, BrCl is a covalent compound because it contains two nonmetals. Lastly, MgF2 is the correct answer because it contains the metal magnesium (Mg) and the nonmetal fluorine (F). Therefore, MgF2 is an ionic compound.