For diatomic molecule, must the 2 atoms be of the same element, e.g H2?Is CO a diatomic molecule?

Yes, CO is a diatomic molecule.

di two
atomic atoms.

Your premise is slightly off.
a diatomic element consists of two atoms of the same element, whilst a diatomic molecule consists of two atoms, either like or unlike.

In a diatomic molecule, there are two atoms that are bonded together. To be considered diatomic, the two atoms can be of the same element, like in the case of H2 (two hydrogen atoms), or they can be of different elements.

CO, which stands for carbon monoxide, is indeed a diatomic molecule. It consists of one carbon atom bonded to one oxygen atom. Therefore, it meets the criteria of having two atoms bonded together, making it a diatomic molecule.