Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started