Question: Write a program that takes a string and determines if all the characters are digits. That is all the characters should be either 1, 2,

Write a program that takes a string and determines if all the characters are digits. That is all the characters should be either 1, 2, .., or 9. The program should output Yes or No as can bee seen by the example below.

If the input is: 1995 the output is: Yes

If the input is: 42,000 or 1995! the output is: No

#include #include using namespace std;

int main() { string userString; cin >> userString;

/* Type your code here. */

return 0; }

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!