0
To find the sum of all the digits of a given no.
2 Answers
0
Hint: use for loop and remainder operator ( % )
0
2 logic.
...1) Use Sum=0; sum =sum+digit;
2) Digit=Num%10;(for last digit)...int Num=num/10;
now change 10 to 100 ,then 100 to 1000 ...so on