Help with While loop

Can someone tell me why my while loop at the end always triggers an "invalid response" even though it does equal "y or n" (Note I did add a cout after the cin to verify that the response does = y or n (this does not need to be there)
1
2
3
4
5
6
7
8
	       cout << endl << "Would you like to see the divisors of another integer (y/n)?"; 
	        cin >> response;
			cout << response;
	      while (response != 'y' && response != 'n');
		 {
			 cout << "Please respond with Y (or y) for yes and N (or n) for no. ";
			 cin >> response;
		 }
anyone?
What is the type of 'response'?
while (response != 'y' && response != 'n'); <-- remove the semicolon
weird.. VS was "expecting a semicolon" so I added it.. then after closing and re-opening when I removed it, everything functions fine. Thanks blue!
kesk it's a "char"
Topic archived. No new replies allowed.