Discussion:
Q: Recognize Digit String Surrounded by Optional White Spaces
Char line [MAXLINE];
int error,;
do {
printf("Input a positive integer: ");
fgets(line, MAXLINE,stdin);
error=sscanf(line,"%d",&n) !=1II n<=0;
if(error)
printf("|nERROR:Do it again.n");
} while(error);