simple question

y my code is keep going

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  #include<iostream>
using namespace std;
int main()
{
	char guess,r,b;
	int num;
	cout<<"\n\nEnter your Guess(r for RED, b for BLACK): ";
	cin>>guess;
	guess=tolower(guess);
	while( guess!='r' or guess!='b')
	{
		cout<<"ERROR! You Entered \""<<guess<<"\"\nPlease Enter \"r\" or \"b\"";
		cout<<"\n\nEnter your Guess(r for RED, b for BLACK): ";
		cin>>guess;
		guess=tolower(guess);
	}
	return 0;
}

Because every character is either not 'r' or not 'b'.

Change the or to and (or &&, same thing).
lol,,,,,,,,,wtf......
thx
Topic archived. No new replies allowed.