Although both CO2 and H2O are triatomic molecules, the shape of H2O molecule is bent while that of CO2 is linear. Explain this on the basis of dipole moment.