title: C++ how to add two numbers in decimal system?
body: <p>I have two numbers 999 and 2. I want to add them in the decimal system, ex:</p>
  
  <pre><code>999
   +2
  ---
  1001
  </code></pre>
  
  <p>First, I am adding 2 with 9 and I'm getting 11 so I'm printing 1 and carrying out 1 for next 9. Similarly getting 10, printing 0 and carrying out 1 for next 9 and adding them. It's like how we used to do addition in our school level. However, now I have to do the same in C++. For this, first I'm splitting 999 and storing in an array. After that adding 2 with the last element of array. If the sum is more than or equal 10, I'm keeping <code>sum%10</code> for the next elements in the array. The problem is, I don't know how can I add the <code>sum%10</code> with the next elements and keep checking if they are more than or equal 10 at the same time for rest of the elements?</p>