IDNStudy.com, kung saan ang iyong mga tanong ay natutugunan ng mga eksaktong sagot. Sumali sa aming platform ng tanong at sagot upang makakuha ng eksaktong tugon sa lahat ng iyong mahahalagang tanong.

A program that would ask for sn integer input snd displays the sum and displays the sum of the digits in the integer.

Sagot :

Instead of storing it as an int, store it as a string, an array of char.  Then, add the its digits using a loop.  Oh, and don't forget to use atoi before operatinf if you want to right.  atoi means alpha to integer, it converts your char type number to an int one

Hope this helps :)
p.s. If there is a part of my solution that you did not understand, please do not hesitate to contact me and I'll be more than glad to explain it to you thoroughly