Javatpoint Logo
Javatpoint Logo

Sum of Digits

To find sum of digits of a number just add all the digits.

For example,


  • Take the number.
  • Divide the number by 10.
  • Add the remainder to a variable.
  • Repeat the process until remainder is 0.


Given program shows the sum of digits of 14597.


PHP Sum of digits 1
Next TopicEven Odd Program

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA