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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!