CNTs are one of the most significant achievements of nano-technology with important applications in the design of electronic nano-devices. Nano-tubes with small size, physical stability and sensitivity of their electric properties to adsorption of N2 and O2 make them ideal materials for use in gas sensors. In this investigation the (DFT) method is utilized to study the adsorption of oxygen, nitrogen molecules on the surface of (5,0) CNT. The electronic structure, NMR spectrum, dipole moment of nitrogen, oxygen and carbon nuclei's are thoroughly studied. The computational results indicate that rich adsorption patterns may result from the interaction of oxygen and nitrogen with the CNTs. Sometimes, C-O bounds are formed via breaking C-C bounds and sometimes a carbon atom in the nanotube is replaced with an oxygen atom. Sometimes oxygen and nitrogen molecular are attracted to a C-C bound. In summary, the optimized adsorption rates are calculated. The nitrogen molecules adsorb with a comparatively lower rate and almost never a chemical binding is formed with the CNT. Gaussian 98 software has been used to carry out quantum chemistry calculations.