title: Reverse Numbers function using recursion in C
body: <p>The following is a function that is meant to return the reverse of a number using recursion.  However, it only returns the last digit of the number.  I'd like to know why and how to fix it?</p>
  
  <pre><code>int rev(int number)
  {
        int revNum=0, sum=100;
  
        if(number&lt;=9) return(number);
        else if(number&gt;0) 
        {
             return(rev(number/10)+revNum);
             revNum=(number%10)*sum; sum=sum/10;
  
        }
  }
  </code></pre>
  
  <p>Thank you!!!</p>