char ans;
do
{
cout<< "Do you want to continue (Y/N)?\n";
cout<< "You must type a 'Y' or an 'N'.\n";
cin >> ans;
}
while((ans !='Y')&&(ans !='N')&&(ans !='y')&&(ans !='n'));
and when i type more than one character, e.x wqe
i got output
Do you want to continue (Y/N)?
You must type a 'Y' or an 'N'.
Do you want to continue (Y/N)?
You must type a 'Y' or an 'N'.
Do you want to continue (Y/N)?
You must type a 'Y' or an 'N'.
Is it possible to just output only one time and not 3 ?