Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

WRITING PART OF TEST 2 You CANNOT log in the Programming Website before you submit your Writing Part ( we will see the log to

WRITING PART OF TEST 2
You CANNOT log in the Programming Website before you submit your Writing Part (we will see the log to detect this)
How to SUBMIT: You must hand-write your solution and and hand submit to the TA/instructor in the classroom.
Website you submit your written solution, log in the Programming there.
PROBLEM DESCRIPTION: Write a program to implement the following requirement:
stdin: a list of digits x1,x2,dots,xn separated by a comma ',' stdout: the SUM of these digits. If stdin is empty, print nothing.
A digit is 0 or 1 or 2,dots, or 9. The number n of digits is not given, but always in the range 0,10. You can only use getchar(), putchar(), and printf() to work with stdin and stdout.
SAMPLE INTPUT 1
5,3,1,4
SAMPLE OUTPUT 1
13
SAMPLE INTPUT 2
5
SAMPLE OUTPUT 2
5
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions