//Chapter-2,Example2_6_3,pg 2-33 wavelength=5890*10^-10 //wavelength of light d_wavelength=6*10^-10 m=2 //for second order N=wavelength/(d_wavelength*m) W=N/500 //as there are 500 lines/cm printf('\n The width of grating is W = %.3f cm',W)