This was originally from another program, but this segment will not work the way I need it to and I imagine others may be having trouble as well. Also of note that after the user input is accepted it is used in a while loop.
printf("would you like to check another time?(y/n)?");
fflush(stdin);
scanf("% c", &yesno);
while(yesno != 'y' && yesno != 'n')
{
printf("That was not a valid entry, please re entery your choice.");
fflush(stdin);
scanf("% c", &yesno);
}/*End of verification loop*/
I want the user to input a character, and after verifying it is either a y or an n, have it go to a while loop where if the character is a y it will continue the program, and if not it will end it.