Ввести Y/N

char charValue, NL;
printf("<Please enter a character>: ");
clearKeyboard();
scanf("%c%c", &charValue, &NL);


while ((charValue != 'Y' && charValue != 'y' && charValue != 'N' && charValue != 'n') ||
          (NL != '\n'))
{
     printf("*** INVALID ENTRY *** <Only (Y)es or (N)o are acceptable>: ");
     clearKeyboard();
     scanf("%c%c", &charValue, &NL);
}

if (charValue == 'Y' || charValue == 'y')
{
     return 1;
}
else
{
     return 0;
}





void clearKeyboard()
{
while (getchar() != '\n');
}