title: Adding Numbers and printing the sum vertically using arrays
body: <p>I have to create a program which adds two integers and prints the sum vertically.<br>
  For example, I have.</p>
  
  <pre><code>a=323, b=322.
  </code></pre>
  
  <p>The output should be:</p>
  
  <pre><code>6
  4
  5
  </code></pre>
  
  <p>I've created the code for when the integers are up to two digits, but I want it to work for at least three digits. </p>
  
  <p>Below is the best I could think of.<br>
  It may be completely wrong, but the only problem I'm facing is the declaration of array.<br>
  It says that the array might not be initialized.<br>
  If I set it to null then also it won't assign values to it later.</p>
  
  <p>I know maybe I'm making a big mistake here, but I'll really appreciate if anyone could help me out.<br>
  Please keep in mind that I must not use any other functions for this code.<br>
  Hope I'm clear.</p>
  
  <pre><code>public class Vert
  {
      public static void main(String args[])
      {
          int n,i=0,j,a=323,b=322;
          int s[];
          n=a+b;
          while(n&gt;9)
          {
              s[i]=n%10;
              i++;
              s[i]=n/10;
              if(s[i]&gt;9)
              {
                  n=s[i];
              }
          }
          j=i;
          for(j=i;j&gt;=0;j--)
          {
              System.out.println(+s[j]);
          }
      }
  }
  </code></pre>