Handling Input Errors: While loop not working

Basically I’m on this lesson in the second C++ course and I cannot get the while loop to work even though I have the same code as him. I’m using visual studio. Whenever I enter a bad input then it just gets stuck in letting me input stuff without ever continuing the program.

I finally found it, my \n had a forward slash instead of a back slash!!