Carbon forms covalent bonds with oxygen. With 6 valence electrons oxygen can form single, double or triple bonds with carbon that has 4 valence electrons. A large number of carbon-oxygen bonds are found in organic compounds. When there is single bond between the two, the other valence electrons are used for bonding with other atoms that form part of the molecule in which the carbon and oxygen exist. A double bond is formed between carbon and oxygen when the carbon lies at the end of a molecule.
Nitrogen with five valence electrons and carbon form a single covalent bond with the remaining electrons used to form bonds with other atoms.
Nitrogen and oxygen can form single as well as double covalent though it is not possible for them to form to form triple bonds.