title: Recursive program can't calculate the sum
body: <p>this is the input write in program 1, 3 , (2,4,6), 5, 7 </p>
  
  <p>and output should be</p>
  
  <pre><code>1+3
  
  1+ ( (2+4)+(2+6)+(4+6))
  
  1+5
  
  1+7
  
  3+ ( (2+4)+(2+6)+(4+6))
  
  3+5
  
  3+7
  
  ( (2+4)+(2+6)+(4+6)) +5
  
  ( (2+4)+(2+6)+(4+6))+7
  
  5+7
  </code></pre>
  
  <p>and i am practicing recursion</p>
  
  <p>so i write the code to calculate the sum of (2,4,6) first</p>
  
  <p>here's my code</p>
  
  <pre><code>#include&lt;stdio.h&gt;
   int recursion(int* array,int i,int j,int size,int sum){
          if(i &lt; size-1){
                 if(j &lt; size ){
                      printf("%d\n",array[i]+array[j]);
                      sum = sum+array[i]+array[j];
                      j++;
                      recursion(array,i,j,size,sum);
  
                 }
                 else{
                       printf("\n");
                       i++;
                       j=i+1;
                       recursion(array,i,j,size,sum);
                 }
          }       
          return sum;
   }
  
  int main(){
     int i=0,j=i+1,sum=0;
     int a[3]={2,4,6};
  
     int c =recursion(a,i,j,3,sum);
     printf("\n\n%d",c);
     return 0;
  }
  </code></pre>
  
  <p>and i always get output of sum <code>6 (2+4)</code></p>
  
  <p>i don't know what's wrong with it? someone can help me?</p>