Char line [MAXLINE];
printf("Input a positive integer: ");
error=sscanf(line,"%d",&n) !=1II n<=0;
printf("|nERROR:Do it again.n");
I assume that you do it in C (so the code looks).
An example of how to modify the code to do what you request is given below.
In case you do it in Visual Studio, I also attach a whole VS6 project in the zip file (it can easily be modified for VS7 and VS8, if needed).
It is worth to look into it in any case, as some of the characters used in ...