(I'm assuming base 10 math) You could cheat. Convert the number to a string with no leading zeros. Capture the left most and right most characters of the string. Convert captured string variables back to integers. Add the integers. (Note: Consider a base string having a string length of 0 or 1.)
5
It appears that only single digit numbers work (0 thru 9)
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
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
If the sum of the digits of a given number equals nine or a multiple of nine, nine is a factor of that number.
12
It is another whole number.
82
81
There are several hundred of them. One example, the smallest, is 1039
36
0.1154
43
12
12
The number is 36.