Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
TypeScript
Determine the sum of al digits of n
samar talaat
Programming language:
TypeScript
2021-04-24 11:27:41
0
Q:
Determine the sum of al digits of n
Levyce
Code:
TypeScript
2021-07-20 01:21:31
def sum_of_digits(n): sum = 0 while (n != 0): sum = sum + int(n % 10) n = int(n/10) return sum
1
Tags
digits
sum
digit
Related
check whether sum of digits is a factor
first k digits of n*n
how to find how many digits a number has in c++
hwo to calculate the number of digits using log in c++
find smallest number whose sum of digits equal to n
Java program to find the sum of all the digits in the inputted number
How to compute all digits of the number
New to Communities?
Join the community