Question: Instructor note: Hint: Check out Figure 4.6.1: Iterating through a string: Counting letters, and review how to use the isdigit() function. LAB ACTIVITY 4.18.1: LAB:
Instructor note:
Hint: Check out Figure 4.6.1: "Iterating through a string: Counting letters", and review how to use the isdigit() function.
LAB ACTIVITY
4.18.1: LAB: Checker for integer string
open_in_newfullscreen0 / 10
Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outputs Yes if every character is a digit 0-9.
Ex: If the input is:
1995the output is:
YesEx: If the input is:
42,000or
1995!the output is:
NoHint: Use a loop and the isdigit() function (don't forget to include the cctype library).

Instructor note: Hint: Check out Figure 4.6.1: "Iterating through a string: Counting letters", and review how to use the isdigit() function. LAB ACTIVITY 4.18.1: LAB: Checker for integer string 0/ Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outputs Yes if every character is a digit 0-9. 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 (don't forget to include the cctype library).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
