Hi All, thanks in advance for any help offered!

I'm trying to write a program that plays the "High Low" game. A user is prompted to type any number between 1-100, the computer generates a random number, and then lets you guess the number. Between each guess, the computer tells you whether to guess higher or lower, until you get the right answer.

I am a beginner here... this is my first program using functions, so please be gentle... The following program hangs after the first prompt and I can't figure out why...

Any suggestions??
_________________

#include <iostream>

using std::cout;
using std::cin;
using std::endl;

#include <cstdlib>

int prompt(int);
void endGame();

int main()
{
enum status {TooHigh, TooLow, WON};
status gameStatus;
int guessNum = 0,
result;

cout << "Please enter a number between 1 and 100 (type 'q' to end the game): ";
cin >> guessNum;

if (guessNum == 'q')
endGame();

else
result = prompt(guessNum);

switch (result) {
case 1:
cout << "Please enter a lower number: ";
cin >> guessNum;
gameStatus = TooHigh;
break;
case 2:
cout << "Please enter a higher number: ";
cin >> guessNum;
gameStatus = TooLow;
break;
case 3:
cout << "Congrats!" << endl;
gameStatus = WON;
break;
}

if (gameStatus == TooHigh || gameStatus == TooLow) {
prompt(guessNum);
}

return 0;
}

int prompt(int number)
{
unsigned int randNumber = 1 + rand() % 100;
int x = number;

while (x != randNumber) {

if (x < randNumber)
x = 1;

else
if (x > randNumber)
x = 2;

else
if (x == randNumber)
x = 3;
}
return x;
}

void endGame()
{
cout << "Thanks for playing..." << endl;
return;
}