Question: Only can include #include #include #include Write a program that reads in any characters from the keyboard, sums up only characters corresponding to a digit

 Only can include #include #include #include Write a program that reads

Only can include

#include #include #include

Write a program that reads in any characters from the keyboard, sums up only characters corresponding to a digit and prints the result on the screen. The program will exit when the character 'Q is entered (upper or lowercase). The char data type treats characters as decimal numbers and uses ASCII (American Standard Code for Information Interchange). Follow the link and use the table to find the character encoding for the digits [0-9]. You will also need the atoi() function from the stdlib to convert ascii to integers. See http://en.cppreference.com/w/c/string/byte/atoi for an example or use google to find some examples. if the input is not a digit you should print the message Input is not a digit For example: Input Output 98q The total is 17 8 QThe Input is not a digit The total is 17 9 a

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