Console application stop return?

Hi, just wondering if they are a way to make it so that when for say the client enters something and it's gone through that proccess, would it be possible so that it returns them to the start again instead of just shutting it down and having to type it in again? Here's an example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 

cin >> sGuessNumber;
if ( sGuessNumber == 5 )
{
    cout << "You guessed 5!" << endl;
    cout << "Play again? Y / N" << endl;
    cin >> sYesorNo;
    if ( sYesorNo == sYes )
    {

      //MAKE THIS BACK TO "cin >> sGuessNumber;"



    }
    else
    {

     return 0;



    }

}



This would help me out ALOT, thanks.
http://cplusplus.com/doc/tutorial/control/

take a look at the while loop
Lol Im an idiot xD I was looking at it and Im thinking maybe that will work... xD
Thanks a lot :)
Any time :]
Topic archived. No new replies allowed.