I really don't understand why i am getting an error on the nested else. (I am very new to cpp) if anyone could help resolve the problem that would be AWESOME.
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
string Answers, True, False, Yes, No;
string mystr;
cout<<"**************Enter Your Desired Player Name Below And Press Enter**************"<< endl<<endl<<endl;
getline (cin, mystr);
cout << "Hello, " << mystr << " ,Would you Like to begin your quest? Yes/No \n"<<endl<<endl;
cin>>Answers;
if(Answers == "Yes" || "yes")
{
string answers, B;
cout<< "Awesome! Well, this is awkward, because i didnt even attempt to write this game."<<endl<< "well lets see what we can do."<<endl<<endl;
cout<< "hmm... erm... Heres a riddle. "<<endl<<"What is tall when it is young,Yet short when it is old?"<<endl<<"A.Melting Chocolate"<<endl<<"B.A Candle"<<endl<<"C.A Skateboard"<<endl<<"D.No clue"<<endl<<"Enter the Assigned Character, Such as A or B." <<endl<<endl;
cin>>answers;
if(answers=="B");
{
cout<<"Well, you aren't completely retarded... Correct"<<endl<<endl;
}
elseif (answers != "B");
{
cout<<"Wrong try again..."<<endl;
}
system("pause");
}
elseif (Answers != "Yes" || "yes")
{
system("Stop");
}
return 0;
}
if(Answers == "Yes" || "yes")
{
string answers, B;
cout<< "Awesome! Well, this is awkward, because i didnt even attempt to write this game."<<endl<< "well lets see what we can do."<<endl<<endl;
cout<< "hmm... erm... Heres a riddle. "<<endl<<"What is tall when it is young,Yet short when it is old?"<<endl<<"A.Melting Chocolate"<<endl<<"B.A Candle"<<endl<<"C.A Skateboard"<<endl<<"D.No clue"<<endl<<"Enter the Assigned Character, Such as A or B." <<endl<<endl;
cin>>answers;
if(answers=="B");
{
cout<<"Well, you aren't completely retarded... Correct"<<endl<<endl;
}
elseif (answers != "B");
{
cout<<"Wrong try again..."<<endl;
}
system("pause");
}
elseif (Answers != "Yes" || "yes")
{
system("Stop");
}