Peterson Number:145 = 1! + 4! + 5!number=sum of (factorials of digits)
# includevoid main(){int no,rem=0,sum=0,n; /*declaration*/printf("Enter 2 digit number:");scanf("%d",&no);for(n=1;n
#include<iostream> unsigned sum_of_digits(unsigned num) { unsigned sum = 0; do { sum += num%10; } while (num/=10); return sum; } int main() { unsigned number = 12345; unsigned sum = sum_of_digits (number); std::cout << "Sum of digits in " << number << " is " << sum << std::endl; }
5
Well, it's very hard to write a flowchart in text, so I'll give you some pseudo code instead. int number = the given number int sum = 0 loop while number is not 0 sum = sum + (number mod 10) number = number / 10
the sum of my digits is 6? answer=60
Add the digits together. The sum of the digits of 23 is 5.
The number is 45. The sum of its digits i.e. 4+5=9 Five times the sum of its digits i.e. 5 times 9 which is 45
8 is the same as the sum of the digits of its cube, 512.
1 + 1 = 2 The sum of the digits is therefore 2.
The sum of your digits is the total number arrived at after adding two or more numbers.
Add the digits together. The sum of the digits of 23 is 5.
The number is 54. The sum of its digits is 5 + 4 = 9. 54/9 = 6.
The sum of the digits is also a multiple of 9. And, if the sum of the digits is too large, you can sum those digits and keep going.
A number is divisible by 3 if the sum of its digits is divisible by 3.
65
1000000