比较两数大小,在循环内为何不能继续执行比较
只能比较一次,比较完之后直接退出。。。。。。
#include <stdio.h>
#include <ctype.h>
int main(void)
{
int num1 = 0;
int num2 = 0;
char judge;
do
{
puts ("Enter the two numbers.");
scanf ("%d%d", &num1, &num2);
if ( num1 > num2)
printf ("\n%d greather than %d", num1, num2);
else
printf ("%d less than %d\n", num1, num2);
puts ("Whether to continue?");
scanf ("%c", &judge);
}while(tolower(judge) == 'y');
return 0;
}