Wavelength lambda = 580nm = 580 x 10^-9 m
Angle = 40 degres
Diffraction order n = 1
Space between the lines is d
Number of lines = 1 / d
Equation for the diffraction which is 2 x d x sin theta = n x lambda
=> d = lambda / (2 x sin theta) = 580 x 10^-9 / 1.285 = 4.51 x 10^-7
Number of lines = 1 / 4.51 x 10^-7 = 0.221 x 10^7 = 2.2 x 10^6 lines / meter
Lines per centimeter = 22000 lines/cm