Can You Write A Program To Add Sum Of Given N Number Of Digit?

1

1 Answers

Ellie Hoe Profile
Ellie Hoe answered
It is very easy just separate the digits from the original number and then add it with one another you can do this by a simple logic:

Let n be your input number, I is a working variable, sum is the total which you want and all are positive integers.

while(n!=0)

        I=n%10;
        n=n/10;
        sum=sum+I;


For complete code click here.

Enjoy blurting :)

Answer Question

Anonymous