The electronic properties of pure and doped carbon nanotubes and NC3-, BC3-, NC- and BC-nanotubes are investigated by using tight binding theory. It was found that applying the external fields and doping change the band gap. The energy gap is reduced by B/N-doping and the reduction value is sensitive to the several parameters such as nanotube diameter and chirality, external field strength, electric field direction, impurity type and concentration. The direct N (B) substitution creates a new band above (below) the Fermi level and leads to creation of n-type (p-type) semiconductor. The external fields modify the band structure and convert the doped nanotube into metal. For both XC and XC3 nanotubes (X=B/N), the gap energy reduction shows identical dependence to electric field and the XC3 nanotubes show more sensitive behavior to electric field rather than XC nanotubes.