while loop

i dont know how to get started on this problem

Write an input validation loop that asks the user to enter Y , y , N , or n .

i know for each letter is a char..can someone help me please
1
2
3
4
5
6
7
8
9
char c;

do
{
   std::cout << "Enter a character: ";
   std::cin >> c;
   
   c = std::toupper( c );
} while ( c != 'Y' && c != 'N' );
Last edited on
Topic archived. No new replies allowed.