title: Recursive function to add sum of sequence of numbers and the sums thereof
body: <p>This was an interview question:</p>
  
  <blockquote>
    <p>Given a sequence of n numbers (n can be any number, assume n &lt;= 100 for this question), say for eg. 11, 23, 9, 17, 20, 8, 5, 6 . <strong>Problem is to write a recursive function in C</strong> to add each number in the sequence to get the sum. If this sum is of more than one digit then sum the digits again and again if the sum is of more than one digit then sum the digits again. Follow this process until the sum is reduced to one digit no. Now add all the sums obtained in the process to output the final sum.</p>
  </blockquote>
  
  <p>For illustration take above sequence: 11, 23, 9, 17, 20, 8, 5, 6 </p>
  
  <p><code>SUM(11, 23, 9, 17, 20, 8, 5, 6) =  99</code> => <code>SUM(9, 9) = 18</code> => <code>SUM(1, 8) = 9</code></p>
  
  <p>Now add all the sums obtained, i.e. <code>SUM(99, 18, 9) = 126</code>  &lt;== should be the output.</p>
  
  <p>Please note that the function should be a <strong>recursive function in C</strong>.</p>