Hi. I'm doing this loop:

It keeps printing:Code:char answer[3]; do { printf("Enter (y/n): "); fgets(answer, sizeof(answer), stdin); } while (!(answer[0] == 'y' && answer[1] == '\0') && !(answer[0] == 'n' && answer[1] == '\0'));

Enter (y/n): Enter (y/n):

twice after each typo someone makes.

I addes fflush() after the printf() since I'm not using the newline, and I still

get the same double output. What am I doing wrong?

Thanks