scanf, , , scanf , . , , , . , , , ..
, , . - fgetc , , :
while (1) {
int i = 0;
int r = scanf("%d", &i);
if (r == EOF) {
printf("Error using scanf()\n");
} else if (r == 0) {
printf("No number found\n");
while (fgetc(stdin) != '\n')
;
} else {
printf("The number you typed in was %d\n", i);
}
}
, !