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
int main() { string userString; cin >> userString;
/* Type your code here. */
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
