Adding individual integers in C - TechRepublic
Question
November 18, 2009 at 05:32 PM
m4rc

Adding individual integers in C

by m4rc . Updated 16 years, 7 months ago

I am somewhat new to C++ (in the sense that I have a pretty good understanding of the concepts of programming, I am just unable to write a substantial program consisting of more than a handful of lines of code…) and am unsure of the best way to accomplish what I want. What I want is to write a program where the user enters an integer and the program adds the individual digits and displays the results. Ex: user enters 215, program adds 2+1+5, and displays the results. I am using Visual Studio 2008 Express, if it is relevant. Any and all suggestions or help would be greatly appreciated. Thanks in advance!

This discussion is locked

All Comments