Digit string surrounded by optional white spaces


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);

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Digit string surrounded by optional white spaces
Reference No:- TGS01932421

Now Priced at $25 (50% Discount)

Recommended (99%)

Rated (4.3/5)