RosettaCodeData/Task/Sum-digits-of-an-integer/00DESCRIPTION
2016-12-05 22:15:40 +01:00

7 lines
445 B
Text

;Task:
Take a   [[wp:Natural_number|Natural Number]]   in a given base and return the sum of its digits:
:* &nbsp; '''1'''<sub>10</sub> &nbsp; &nbsp; &nbsp; &nbsp; sums to &nbsp; '''1'''
:* &nbsp; '''1234'''<sub>10</sub> &nbsp; sums to &nbsp; '''10'''
:* &nbsp; '''fe'''<sub>16</sub> &nbsp; &nbsp; &nbsp; sums to &nbsp; '''29'''
:* &nbsp; '''f0e'''<sub>16</sub> &nbsp; &nbsp; sums to &nbsp; '''29'''
<br><br>