Question: Write a c + + program that takes in a C - string as input, and outputs yes if every character in the C -

Write a c++ program that takes in a C-string as input, and outputs yes if every character in the C-string is a digit 0-9.
The input will contain with a maximum of 6 characters before the null.
You'll need to include additional header files in your solution.
Ex: If the input is:
1995
the output is:
yes
Ex: If the input is:
42,000
or
1995!
the output is:
no
Hint: Use a loop and the isdigit() function.

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 Programming Questions!