Respuesta :

Answer:  

The code to this question as follows:  

Code:  

do{ //do-while loop  

cin >> c; //input value from user.  

}while (!(c == 'Y' || c == 'y' || c=='N' || c == 'n')); //check condition.  

Explanation:  

The description of the code as follows:  

  • In this code, we use a do-while loop. It is an exit control loop. In the loop, we use the char variable that is "c" this variable is used for user input. End of the loop we define the condition that is variable c value is not equal to "y", "Y", "n" and "N".  
  • In the loop, we use OR operator that means if any of the above conditions is match it will terminate the loop.