Hybridization of carbon in CO2 I know that if there exists a carbon atom with single bonds only (with other atoms),then it is $\mathrm{sp^3}$ hybridized. And if at least one of the bond is double bond then its $\mathrm{sp^2}$ hybridized (not talking about two double bond on same carbon atom). And if there is at least one triple bond then its $\mathrm{sp}$ hybridized. But then carbon in carbon dioxide should be $\mathrm{sp^2}$ hybridized. But if I am right our teacher told it was $\mathrm{sp}$ hybridized. How is that possible if the carbon atom bears no triple bond?
Hybridization is determined by molecular geometry. Carbons participating in triple bonds like those in acetylene have two regions of electron density. Carbon dioxide is a linear molecule, and also has two regions of electron density. The fact that both have two regions of electron density are what make these carbons $\mathrm{sp}$ hybridized.

To reenforce hybridization is determined by molecular geometry, consider the benzyne intermediate. It has a triple bond, but is $\mathrm{sp^2}$ hybridized because it is too strained to become linear and only have two regions of electron density.