Which formula for the de Broglie wavelength of an electron is correct?

So, I have my exams in physics in a week, and upon reviewing I was confused by the explanation of de Broglie wavelength of electrons in my book. Firstly, they stated that the equation was: $\lambda =\frac{h}{p}$, where $h$ is the Planck constant, and $p$ is the momentum of the particle. Later, however, when talking about electron diffraction and finding the angles of the minima, the author gave the formula equivalent to that for light: $\lambda =\frac{hc}{E}$. Now, what I don't understand is if it is simply a mistake made by the author, or whether a different formula have to be used for electron diffraction, as the two formulae are very clearly not equivalent. In the latter case, I don't understand why the formula would be different. I greatly appreciate the help, as the exams are really close, and I would like to make sure I get this right!

Edit: I was told that pictures of text are taking away from the readability of the posts, and thus they were removed. Essentially, the difference between the two cases are that in the first case, the proton did not have any significantly large kinetic energy, while in the second example, the kinetic energy was $400\text{}MeV$

So, I have my exams in physics in a week, and upon reviewing I was confused by the explanation of de Broglie wavelength of electrons in my book. Firstly, they stated that the equation was: $\lambda =\frac{h}{p}$, where $h$ is the Planck constant, and $p$ is the momentum of the particle. Later, however, when talking about electron diffraction and finding the angles of the minima, the author gave the formula equivalent to that for light: $\lambda =\frac{hc}{E}$. Now, what I don't understand is if it is simply a mistake made by the author, or whether a different formula have to be used for electron diffraction, as the two formulae are very clearly not equivalent. In the latter case, I don't understand why the formula would be different. I greatly appreciate the help, as the exams are really close, and I would like to make sure I get this right!

Edit: I was told that pictures of text are taking away from the readability of the posts, and thus they were removed. Essentially, the difference between the two cases are that in the first case, the proton did not have any significantly large kinetic energy, while in the second example, the kinetic energy was $400\text{}MeV$