While statement problems

Hello everyone, this code is supposed to take tickets at a concert, count them, output them and say how many green/blue tickets you received. I am new and I would like some help polishing this turd. First of all, I can't get the loop to activate no matter what I type into it, then I can't get it to output the answer once I press n and try to end the loop, plus any other problems you guys find. TIA

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
39
40
41
42
43
44
45
  #include <iostream>

using namespace std;

int main()
{
	int green = 0;
	int blue = 0;
	char answer;
	char color;

	cout << "start counting tickets? (y/n)" << endl;
	cin >> answer;

	while (answer == 'y', 'Y')
	{
		cout << "enter b for blue and g for green " << endl;
		cin >> color;
		if (color == 'b')
		{
			blue++;
		}
		if (color == 'g')
		{
			green++;
		}
		else
		{
			cout << color << " is not a valid input, try 'b' or 'g'." << endl;
		}
		
		cout << "Continue counting tickets? (y/n)" << endl;
		cin >> answer;
	
	
	}


	
	cout << blue << " blue tickets, " << green << " green tickets today. " << endl;



	return 0;
}
while (answer == 'y', 'Y') should be while (answer == 'y' || answer == 'Y').
Topic archived. No new replies allowed.