Hi
When i compile my code, it works alright, no errors, but when i run it, i get to a certain point where the program sort of goes out of control.
Here is the code:
Code:
#include <iostream>
using namespace std;
int main()
{
int DOB;
int AGE;
int MONTH;
int DATE;
do
{
cout << "Please enter your date of birth...\n" << endl;
cin >> DOB;
cin.ignore();
if (DOB < 2006)
{
cout << "Really? What day?\n" << endl;
cin >> DATE;
cin.ignore();
}
else if (DOB == 2006)
{
cout << "Really? How old are you?\n" << endl;
cin >> AGE;
cout << "...and what month?\n" << endl;
cin >> MONTH;
cin.ignore();
}
else
{
cout << "What are you on about? You arn't even born yet!\n" << endl;
}
}
while(DOB != -1);
cin.get();
}
can anyone help me?