Qbasic Program to print sum of digits of the given number
Posted by Mahibabu
REM Program to print sum of the digits of a given number
CLS
INPUT "Enter any digit"; n
WHILE n <> 0
r = n MOD 10
s = s + r
n = n \ 10
WEND
PRINT "Sum of digits is "; s
END