Rem Sumdigit.bas - Program to find the sum of digits of given integer
10 Input "Enter a positive integer:", n
if n < 0 or int(n) <> n then print "Invalid Integer.Re-enter" : goto 10
sum = 0
while n > 0
  digit = n mod 10
  n = n \ 10
  sum = sum + digit
wend
print "Sum of Digits = "; str$(sum)

