Computer Science, asked by Lakshita4432, 11 months ago

Programm to find minimum of numbers and the sum of minimum number until it reach to single digit

Answers

Answered by amritaraj
1

Answer:

Explanation:

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  

Similar questions