Nested else if?

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.
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
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
#include <string>
using namespace 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;
		}
		else if (answers != "B");
		{
			cout<<"Wrong try again..."<<endl;
		}
		
	
		system("pause");
	}
	else if (Answers != "Yes" || "yes")
	{
		system("Stop");
	}


	
return 0;
}

This part to be exact
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
		}
		else if (answers != "B");
		{
			cout<<"Wrong try again..."<<endl;
		}
		
	
		system("pause");
	}
	else if (Answers != "Yes" || "yes")
	{
		system("Stop");
	}
Last edited on
remove the semicolon on line 18 and 22
Thank you peter! worked like a charm.
Topic archived. No new replies allowed.