RosettaCodeData/Task/Sum-digits-of-an-integer/00-TASK.txt

9 lines
446 B
Plaintext

;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>