Computer Guessing game

So I'm supposed to make a program where you think of a number and the computer tries to guess it. However, it seems to be getting stuck in an infinite loop and I can't figure out why. Here's my code, any tips?

I rewrote your code to flow a little bit better. Also, I didn't do ALL the work, but enough to hopefully let you fill in the blanks and complete your assignment ;) As long as your user eventually enters 3, this will keep you from an infinite loop scenario.

Oh the irony of life... so I was doing a few of the beginner tutorials on this website just to test my skills and I found basically the same problem you did here. So I did the whole program. Since you're complete, I'd love to see your solution to do a little compare and contrast.

"Hello World" at this point is more traditional. Every language I've ever learned or attempted to learn started with this. I think it's more used to just verify the compiler and IDE are setup and working correctly. In some cases, might also introduce the future programmer to key or generic libraries (like iostream).

The others are more common for beginners because they are not very complicated, yet touch on the basics of syntax and logic.