Write a python program to find the single-digit number?
Answers
Answered by
2
Answer:
Finding sum of digits of a number until sum becomes single digit
Given a number n, we need to find the sum of its digits such that:
If n < 10
digSum(n) = n
Else
digSum(n) = Sum(digSum(n))
Examples :
Input : 1234
Output : 1
Explanation : The sum of 1+2+3+4 = 10,
digSum(x) == 10
Hence ans will be 1+0 = 1
Input : 5674
Output : 4
Answered by
1
Answer:
Which pytho???? there are many python s
Similar questions