Программа игнорирует Stop, когда amt равно 0, до тех пор, пока не будет введено 10 чисел. Программа также не останавливается после ввода 10 чисел. Где моя ошибка?
main() {
int amt;
int tot = 0; /* running total */
int i = 0; /* counts number of times in loop */
while (amt!=0 || i < 10)
{
printf("Enter a number (enter 0 to stop): ");
scanf("%d", &amt);
tot = tot + amt;
i++;
}
printf("The sum of those %d number is %d.\n", i, tot);
}