title: How do you get the sum of two arrays while keeping track of carry (like bigInt in java)?
body: <p>I'm still learning to program and i'm trying to add two arrays, A and B, while keeping track of carry. The arrays are all of <code>SIZE = 20</code> and look like this: <code>A = {0,0,..,n}</code>
  My code below does not seem to work and I cannot for the life of me find out what the error is. For example, if I add
             <code>A ={0,0,0...,1,2,3}</code> as an array and
            <code>B ={0,0,0,...,7,8,9}</code> as an array I get <code>802</code> instead of <code>912.</code><br>
   Code: </p>
  
  <pre><code>    int index = SIZE -1; 
      int[] newBI = new int[SIZE]
      while(index &gt;=0)
      {   
          int carry = 0; 
          int sum = A[index] + B[index] + carry;
          if(sum &gt;=10) {
              carry = sum/10;
              sum = sum %10; 
  
          }
          newBI[index] = sum; 
          index--; 
      }
      return newBI; 
  }
  </code></pre>
  
  <p>Please help!</p>