usually a while loop works nicely here. you can have a boolean variable that you set to true if answered, false if not, and then put all the user interaction stuff in the while loop and only exit the loop if the answer is true. (but how are they going to guess numbers like that?). Also, you may wish to look into tacking an else block after your if block instead of another if (xxx != yyy).
e.g.
Code:
boolean done = false;
while (!done) // while not done
{
// prompt for user input
// get user input
// test user input
// if user input good then done = true
}