# Sum of the digits

**URL:** <https://forum.kirupa.com/t/sum-of-the-digits/146011>\
**Category:** Uncategorized\
**Created:** [April 27, 2005, 3:45pm UTC](https://forum.kirupa.com/t/sum-of-the-digits/146011 "2005-04-27T15:45:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hommer](https://avatars.discourse-cdn.com/v4/letter/h/a3d4f5/32.png) [@Hommer](https://forum.kirupa.com/u/Hommer)\
**Post date:** [April 27, 2005, 3:45pm UTC](https://forum.kirupa.com/t/sum-of-the-digits/146011/1 "2005-04-27T15:45:40Z")

</div>

I have a variable and I want to find the sum of the digits. How do I do that?

```
I.e. I have
n = 273
And I want to find the sum: 2+7+3 = 12
```
