C语言while循环问题

#include<stdio.h>
int main(void)
{
int guess = 1;
char response;

printf("Please pick an integer from 1 to 100. I will try to guess it.\n");
printf("Response with a y if my guess is right and with an n if it is wrong.\n");
printf("Uh... is your number %d?\n", guess);
while ((response=getchar()) != 'y')
{
    guess++;
    if (response == 'n')
    {
        printf("Well, then, is it %d?\n", guess);
    }
    else
    {
        printf("Sorry, I understand only y or n.\n");
    }
    while (getchar() != '\n')
    {
        continue;
    }
}
printf("I knew I could do it!\n");

return 0;

}

小while循环的条件改成response != '\n',大循环就会卡住动不了,这是为什么?

while (getchar() != '\n')是每次都重新读取一个新的字符,判断直到读取的是\n为止,
如果改成response != '\n'就不会重新读取新的字符

不是大循环卡住,是 while (response != '\n') 条件一直成立,进入死循环