title: How to add 2 to each digit in a 4 digit number in C
body: <p>I am trying to solve this tutorial practice question that doesn't have an answer that I can check my code against. The goal is to write a program to display numbers whose digits are <code>2</code> greater than the corresponding digits of the entered number. So if the number input is <code>5656</code> then the output number should be <code>7878</code>. I have figured out how to separate each number and add them, but I can't seem to get them to print in a <em>four-digit</em> sequence. </p>
  
  <hr>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main ()
  {
      int n, one, two, three, four, final;
      scanf("%d", &amp;n);
  
      one   = (n / 1000);
      n     = (n % 1000) + 2;
      two   = (n / 100) + 2;
      n     = (n % 100) + 2;
      three = (n / 10) + 2;
      n     = (n % 10) + 2;
      four  = (n / 1) + 2;
      n     = (n % 1) + 2;
  
      final = (one * 1000) + (two * 100) + (three * 10) + four;
  
      printf("%d", final);
      return 0;
  }
  </code></pre>