Instructor note: Hint: Check out Figure 4.6.1: Iterating through a string: Counting letters, and review how to
Fantastic news! We've Found the answer you've been seeking!
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: 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:
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).
Related Book For
Accounting Information Systems
ISBN: 978-1133935940
10th edition
Authors: Ulric J. Gelinas, Richard B. Dull
Posted Date: