The energy per photon can be calculated through this formula:
E = hc/λ
where
h is Planck's constant = 6.626x10⁻³⁴ J·s
c is the speed of light = 3x10⁸ m/s
λ is the wavelength
The wavelength is given to be 540 nm or also equivalent to 543x10⁻⁹ m.
Substituting the values,
E = (6.626x10⁻³⁴ J·s )(3x10⁸ m/s )/(543x10⁻⁹ m)
E = 3.66x10⁻¹⁹ J/photon