Question: please write in C++ 1] How to make sure the user entered an integer in C: char s[MAX LINE]; Minus one, to skip the newline
![please write in C++ 1] How to make sure the user](https://s3.amazonaws.com/si.experts.images/answers/2024/08/66c2d642ccc0b_86666c2d642651e4.jpg)
please write in C++
1] How to make sure the user entered an integer in C: char s[MAX LINE]; Minus one, to skip the newline character. fgets(s, sizeof (s), stdin); valid TRUE; for (i -0; i strlen(s)i ++i) if (lisdigit(s[i)) valid FALSE; break; Use the idea shown above to write a loop that only exits when the user has entered an integer
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
