I want to get only y and n from user to enter
when user try to enter another it get the input again until user enter
"y" or "n"
i use this logic but its not working
do
{
cout<<"\n\n Enter Number: ";
number=getche();
cout<<"\n Want to enter another:(y/n)";
ans=getche();
if(ans!='n'||ans!='y')
ans=getch();
}
while(ans!='n');