while语句一点小问题?
这个程序到底哪里有问题?为什么输入y不能结局循环?#include <stdio.h>
int main()
{
int guess = 1;
printf("Pick an integer from 1 to 100. I will try to guess ");
printf("it. \nRespond with a y if my guess is right and with");
printf("\nan n if it is wrong. \n");
printf("Uh...is your number %d?\n", guess);
while(getchar() != 'y')
printf("Well, then, is it %d?\n", ++guess);
printf("I knew I could do it!\n");
return 0;
}