title: How to ignore/remove leading zeros?
body: <p>I am writing a program to add two large numbers in <code>C</code>. 
  My integer array result holds the sum of  the two numbers (which were also stored in arrays).</p>
  
  <p>For example, if the result array is <code>[0,0,3,2]</code> (actual array size is 20)</p>
  
  <p>If 32 is my actual result, how can I display the contents of the result array without the leading zeros ?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  #define BASE 10
  void align(int A[],int n);
  void add(int A[],int B[], int C[]);
  void Invert(int* a, int n);
  
  int main(int argc, char** argv){
      char input1[20];
      char input2[20];
      int size = 20;
      int a;
      int b;
      int num1[20];
      int num2[20];
      int result[20];
      int length1 = strlen(argv[1]);
      int length2 = strlen(argv[2]);
      int i = 0;
      for (i=0;i&lt;length1;i++){
         input1[i] = argv[1][i];
      }
      for (i=0;i&lt;length2;i++){
          input2[i] = argv[2][i];
      }
  
      a=atoi(input1);
      b=atoi(input2);
      align(num1,a);
      align(num2,b);
      add(num1,num2,result);
      Invert(result,size);
      for (i=0;i&lt;20;i++){
          printf("%d",result[i]);
      }
  
      return 0;
  }
  
  void align (int A[], int n){
      int i = 0;
  
      while (n) {
          A[i++] = n % BASE;
  
          n /= BASE;
      }
  
      while (i &lt; 20) A[i++] = 0;
  }
  
  void add (int A[], int B[], int C[]) {
      int i, carry, sum;
      carry = 0;
      for (i=0; i&lt;20; i++) {
          sum = A[i] + B[i] + carry;
          if (sum &gt;= BASE) {
              carry = 1;
              sum -= BASE;
          } else
              carry = 0;
          C[i] = sum;
      }
  
      if (carry) printf ("overflow in addition!\n");
  }
  
  void Invert(int* a, int n)
  {
      int i;
      int b;
      for(i=0; i&lt;n/2; i++){
          b = a[i];
          a[i] = a[n-i-1];
          a[n-i-1] = b;
      } 
  }
  </code></pre>
  
  <p>`</p>