title: Recursive finding and filling the multiplication of given array value with all previous array values
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  //hope to get answer using recurssion
  void atoA(int a[],int A[],int i,int size){
  
     if(i&lt;size){
        if(i==0){ A[i]=a[i];}
        else{
           A[i] = a[i]+A[i-1];
  
        }
        atoA(a,A,i++,size);
     } 
  }
  
  
  int main(){
  
     int a[]={1,8,4,7,6,2,3,9};
  
     int size = sizeof(a)/sizeof(a[1]);
  
     int A[size],i,j;
  
     atoA(a,A,0,size);
     /*The answer without recurssion
       for(i=0;i&lt;size;i++){
       if(i==0) A[i]=a[i];
       else A[i] = a[i]*A[i-1];
       }
      */
     for(j = 0;j &lt; size ; j++){
        printf(" %d ",A[j]);  
     }  
  }
  </code></pre>
  
  <p>So for array</p>
  
  <pre><code>{2,4,3,6}
  </code></pre>
  
  <p>Output should be </p>
  
  <pre><code>{2,8,24,144}
  </code></pre>
  
  <p>My iterative version is OK</p>
  
  <p>I tried doing recurrsively modifying and try to print them but could not get the answer it say </p>
  
  <pre><code>Segmentation fault : CORE DUMP
  </code></pre>
  
  <p>Can someone point out where i did wrong and what should i modify.Somwhere in calling the function again i feel somewhere it keeps going. I did specify all the constraints but still there seems to be someproblem that persists and i cannot pin point the location.</p>