Sum digits of an integer: Difference between revisions

(Dialects of BASIC moved to the BASIC section.)
Line 922:
110 END
</syntaxhighlight>
 
==={{header|Palo Alto Tiny BASIC}}===
{{trans|Tiny BASIC}}
Only base ten is supported. Palo Alto Tiny BASIC does not support operations on strings.
<syntaxhighlight lang="basic">
10 REM SUM DIGITS OF AN INTEGER
20 INPUT "ENTER A NUMBER"N
30 LET N=ABS(N),U=0
40 IF N=0 GOTO 80
50 LET U=U+N-N/10*10
60 LET N=N/10
70 GOTO 40
80 PRINT "ITS DIGIT SUM:",U
90 STOP
</syntaxhighlight>
{{out}}
<pre>
ENTER A NUMBER:-12321
ITS DIGIT SUM: 9
</pre>
 
==={{header|PureBasic}}===
512

edits