Okay I'm a little lost in your question mastrgamr but I think you asked
how to keep the program from closing after you enter the right age?
Once the right age is entered where you typed your if statement
under good choice declare a variable as an int name it condition and give it a value of 1
create a while loop that runs while condition == 1
then inside of the loop give the user something to do
such as an input and if they enter x then it ends the loop
here is an example
int condition = 1;
char exitvar = 'a';
while (condition == 1)
{
cout << "type x to leave\n";
cin >> exitvar;
if (exitvar == 'x')
{
condition = 0;
}
else
{
exitvar = 'a';
}
}
~ Geo
~ Don't take life too seriously, you'll never get out alive!
|