How to sum different digits in one integer? For example: int = and 411;
I want to pull out the numbers and sum them: 4 + 1 + 1 = 6
, tried in various ways, but I gather ASCII value in the table, and I do not want it?
Asked
Active
Viewed 428 times
-4

Hamid Pourjam
- 20,441
- 9
- 58
- 74

Nick1R1
- 1
- 2
-
2Dont be worry to show your failed attempts, nobody will make fun of you for your code. Instead just asking someone to solve your problem is not well accepted here. Read the [help] – Steve Aug 15 '15 at 16:51