#include int main() { int age; char buf[50]; while (1) { printf("How old are you?\n"); if (fgets(buf, 50, stdin) == NULL) exit(0); if (sscanf(buf, "%d", &age) == 0) printf("That is not a valid age.\n"); else if (age < 0) printf("A negative age is impossible.\n"); else if (age < 4) printf("Unlikely.\n"); else break; } printf("Big deal, I'm %d\n", age + 3); return 0; }