I need help mofiying this code. As is right now, it will catch some typing errors. But if I type 54y it will not catch it. How can I modify this code so it will catch those type of errors?
Code:#define MAXLINE 100 char line[MAXLINE]; int error, n; do{ printf("Input a positive integer: "); fgets(line, MAXLINE, stdin); error = sscanf(line, "%d", &n) != 1 || n <= 0; if(error) printf("\nDo it again!\n"); } while(error)