Closed Solved

C programming solver

Hello,
please solve this very very immediately.


Find the sum of all the digits of a user input positive integer.
Remember, the user inputs the number as one input (use one scanf() only). That is to say that the digits are not to be treated separately.

For example, some sample runs are presented here:

Enter a positive integer: 1<enter>
1 = 1

Enter a positive integer: 125<enter>
1 + 2 + 5 = 8

Enter a positive integer: 5646876<enter>
5 + 6 + 4 + 6 + 8 + 7 + 6 = 42

Enter a positive integer: -123<enter>
Number not valid! Please enter a positive number.
5 answers Last reply Best Answer
More about programming solver
  1. Best answer
    I'm sure this is homework you were assigned.

    Something like this isn't to difficult to do, you'll learn far more by learning how to do it yourself
  2. This even looks like a copied and pasted assignment!
  3. This topic has been closed by Area51reopened
  4. Best answer selected by Area51reopened.
Ask a new question

Read More

Integer Programming Windows 7