title: Subtracting digits from an integer right to left
body: <pre><code>#include &lt;stdio.h&gt; 
    
  void printDigit(int n) 
  { 
      int d; 
      int temp;
      int temp2;
      if (n == 0) { 
          return; 
      } 
      d = n % 10; 
      printf(&quot;%d &quot;, d);
      printDigit(n / 10); 
  } 
  
  int main() 
  { 
      int n = 755545; 
    
      printDigit(n); 
      return 0; 
  } 
  </code></pre>
  <p>So I need to subtract each digit with the next one right to left, so for example 5-4=1, 4-5=-1 and then print them like xxxx -1 1 . I tried something like getting a temp int in there but I need it changed every recursion.</p>
  <p>Edit: for the input number 755545 the output should be -2 0 0 -1 1.</p>