sum of digits

Solutions on MaxInterview for sum of digits by the best coders in the world

showing results for - "sum of digits"
Delfina
30 May 2016
1num = [int(d) for d in input("Enter the Number:")]
2sum = 0
3for i in range(0, len(num)):
4    sum = sum + num[i]
5
6print("Sum of Digits of a Number: {}".format(sum))
7
8# This code is contributed by Shubhanshu Arya (Prepinsta Placement Cell Student) 
Valentín
02 Oct 2020
1def getSum(n)
2  n.digits.sum
3end
4
5print "Sum of digits = ", getSum(555);
Marlene
24 Sep 2016
1#include <stdio.h>
2 
3int getSum(unsigned long long n) {
4    int sum = 0;
5    for (; n; n /= 10)
6    	sum += n % 10;
7    return sum;
8}
9
10int main(){
11	printf("Sum of digits = %d\n", getSum(555));
12}
queries leading to this page
sum of all digits of a number for single digitcalculate the total of all digits in intergerprogram for sum of the digits of a given numbersum number digitsum of a digits of number what is the sum of the digits of integer x 2c where x 3d 810 c3 97 526 3fgiven the length and sum of digitssum of all digits in a numberhow to calculate sum of digits of a numbersum of digits of a numbercode for sum of digitsint sum of digits 28int n 29compute the sum of digits in a given integerhow to add digits of a numbernumber sum of digitswrite a program to calculate sum of digits of a numberfastest way to find sum of digits of a numberprogram to find sum of its digitsprogram to find sum of digits of a numbersum of digits algorithmwrite a program to calculate the total sum of the digits in the integers from 1 to a millionsum of digits propertiessum of digits of a number is 9number digits sumto find the sum of digits of a number and its equivalentsum the digits of an integerreturn the sum of its digits sum of digits of a number upto single digitdigit and sum of digitprogram to calculate sum of digits of a numbersum of the digit sum of digits of number upto single digitsum of digits in a numbersum of digits including 10sum of all numbers of a digitfind sum of int digitsum of all digits in numberhow to get the sum of all the digits of a numberhow to calculate sum of digits of the result what is sum of number digitssum of digitssum of its digitshow to find the sum of the digitshow to find sum of digits of numbers using 25how to get the sum of digits formulasum of digit of a number in o 281 29sum of digits in a number in o 281 29sum digits of numberwhat is the sum of the digits calledsum of the digit numbernumber of digits in sumfind sum of digits in a numberget number of digits in a number and sum of digitsto find the sum of the digits of a number function to get sum of digits in a numbercalculate sum of integers with 4 digitsthen prints the number and the sum of its digitsfind a sum of sum of sum of digits of numbersum of digits of an integerfind the sum of the digits in the number 1000 21 what is the sum of the digits of integer x 2c where x 3d 8 5e10 c3 97 5 5e26 3fturn a number into the sum of its digitsthe sum of all the possible numbers of 4 digits formed by digits 3 2c 5 2c 5 2c and 6 using each digit once is find the sum of digits of a numberprogram to sum of digitssum 3dsum 2bdigit 2510 3bdigit 3ddigit 2f10 3bsum 3dsum 2bdigit 2510 3bdigit 3ddigit 2f10 3bsum 3dsum 2bdigit 2510 3bdigit 3ddigit 2f10 3b in c program to find the sum of digitssum of numbers in digitstotal digitssum of all numbers formed from given digitsfind numbers whose sum of digits is 1how to calculate sum of all digits in a given numberhow to find the sum of the digits of a numbersum of digit of numberprogram for sum of digitscalculate the summation of digits of a number calculate sum of digits of number in o 281 29find the number of 6 digits numbers whose sum is 10 2c using the digits 1 2c 2 2c 3 only sum of digits sum of digits of a given numberfind number given sum of digits and number of digitsif sum of digits of a number is 1write a function digitsum that calculates the digit sum of an integer the digit sum of an integer is the sum of all its digits program that compute the value of the sum of the digits in an integersum digits onlineprogram to find sum of digits of a number reducing into single digitsum of digits methodcalculate sum of digits of a number formulacount the sum of digits4 sum of digits of a numbersum of digits recusrionfunction returns sum of digitshow to get the sum of a digitgiven a number find the sum of its digitscount total digits in a numberthe sum of the digits of the numbercalculate sum of digits of integerhow to take sum of digits of numbersum of all the digits of a numberwhat does the sum of the digits of the number meannumbers sum in digitsum of the digitssum the digits in an integerprogram to find the sum of digits of a numbereturn the sum of digitssum of numbers formed by digitshow to add digits to numberhow sum of all digits workthe sum of the digits in n 21sum of digit in o 281 29find out the sum of all the digitssum of digits sequencesum of the digits in numberhow to find the sum of digits of a numbersum of the digits of a number is 9integer and then prints the number and the sum of its digits how to find sum of digit of numbersum of digits of 4 digit numbercompute sum of digits in all numbers from 1 to nfinding sum of digithow to find digits of sum is givengiven a number a 2c we need to find sum of its digitssum of digits in numberfind sum of digits algorithmformula for sum of digitsint sum numberscalculate sum of integers up to integerfinding sum of digits of a numbersum of digits formulasum of digits of a number onlinecalculating sum of digit of a number given integers a and b find the sum of digits given length and sum of digits sum of digits to single digitsum of sum of digitsprogram to calculate sum of all digits in a given numberwrite a function that finds the sum of the digits in any given integer take a number and sum its digitssum digits of a numberfunction to obtain sum of digits in a given numbersum of digits in a single digithow to sum digits of a number insum digits of integercalculate sum of digits of a numbersum of digit in integerhow to find the sum of digitssum of digits fomulasum of digits in number simplest codesum digitsprogram to sum of digits of a numbersum of all the sum of its digits in between numberssum of digits of a number x and ygiven length and sum of digitsfind sum of digits of a numbersummation of its digits number of numbers with given sum of digitssum all the digits in the numbersum of digits in number onlinedigits sumwrite a program to find sum of digits of given numbersumming up the digitssum of numbers of an intfind sum of digitssum of all digits of a numberto find the sum of digits of a numberhow to find sum of digits of the integer n when written in base b sum a digit of numberwhat is the sum of the digitssum of digithow to find sum of digits of a numberthe sum of the digits digits summationsum of digits