Here's a more concise loop condition

while (strrchr("YN", topper(c)) == NULL)

After topper returns c''s value in uppercase, strrchr looks for the uppercase letter in "YN". If it's not there, strrchr returns NULL.

To use strrchr, you'll need to include ctype.h.