RosettaCodeData/Task/Sum-digits-of-an-integer/00-TASK.txt
2023-07-01 13:44:08 -04:00

8 lines
446 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>