Okay I know I've been asking a lot of questions, but I need this to work. Here's my problem; I tried to do a semi-simple math problem, which is "If your (age) then how old will you be in 10 years". Here is the code I used. It's giving so many errors. The string "age" has already been made earlier in the code.
1 2 3 4 5 6 7 8 9 10 11 12 13
Sleep(500);
cout<<endl;
cout<<"If your'e "<<age<<" then how old will you be in 10 years?\n"<<endl;
int nage;
cin>>nage;
if (nage == age + 10)
{
cout<<"Your'e right! good job\n";
}
else
{
cout<<"Are you serious, come on, it's simple addition!\n";
}
Just saw you already declared age. You are declaring nage a int, and age is a string, you can not compare a string to an int variable, they both need to be int OR both need to be string.