Answer
Ionic bonds are generally formed between metals and non metals, in this case Potassium is a metal and Chlorine is a non-metal. While covalent bonds are generally formed between non=metals, in this case between Carbon and Nitrogen.
Oxygen forms polar covalent bond with Hydrogen due to the difference in the electronegativities of both elements.
Work Step by Step
See answer.