Adding all possible combinations of numbers in a array then outputting solutions and the numbers that make up the sums in c++
<p>Hi my program is supposed to allow the user to input 4 numbers of their choosing.  Once the numbers have been inputted it multiplies each number by .40, and this augmented number becomes stored in an array.  The goal of the program that it adds up every combination within the array and outputs not only the answer but the numbers used to make the answer</p>

<p>My problem is I can get the user to input the numbers, and I can add all possible combinations my problem is that the numbers that are outputted that are supposed to be what numbers I used to create the sum are not correct</p>

<pre><code>#include&lt;iostream&gt;

using namespace std;

int ratings[4];
void getRatings();
void potentialReforges(int index, int augAmount,int ratings[] ,int arrayLength);

int main()
{
    getRatings();
    int i = 0,arrayLength = 3, augAmount =0;
    potentialReforges(i,augAmount,ratings,arrayLength);
    return 0;
}


void getRatings(){
    int input1, input2, input3, input4;
    cout &lt;&lt; "Enter a number\n";
        cin &gt;&gt; input1;
        ratings[0] = input1*.40;
    cout &lt;&lt; "Enter a number\n";
        cin &gt;&gt; input2;
        ratings[1] = input2*.40;
    cout &lt;&lt; "Enter a number\n";
        cin &gt;&gt; input3;
        ratings[2] = input3*.40;
    cout &lt;&lt; "Enter a number\n";
        cin &gt;&gt; input4;
        ratings[3] = input4*.40;

    cout &lt;&lt; "\n\n\n\n";
}

void potentialReforges(int index,int augAmount, int ratings[] ,int arrayLength){
    int i, j, augRating = 0, temp = 0;

    for(i=index; i&lt;=arrayLength; i++){
        for(j=temp; j&lt;=index; j++){
        for(j=temp; j&lt;=index; j++){
            cout &lt;&lt; ((ratings[j])) &lt;&lt; " + ";
        }
        temp++;
        }
        augRating = augAmount + ratings[i];
        cout &lt;&lt; " = " &lt;&lt; augRating &lt;&lt; "\n";


        potentialReforges(i+1, augRating, ratings, arrayLength);

    }
}
</code></pre>

<p>With the numbers 500, 718, 377, and 200 I get </p>

<pre><code>200 + = 200
200 + 287 + = 487
200 = 287 + 150 + = 637
200 + 287 + 150 + 80 = 717
287 + 150 + = 567
287 + = 350
200 + 287 + 150 + 80 = 430
 = 280
 = 287
200 + 287 + 150 + = 437
200 + 287 + 150 + 80 = 517
287 + 150 + = 367
 = 150
200 + 287 + 150 + 80 + = 230
= 80
</code></pre>

<p>As you can see ALL the answers are correct AND the first 4 Sums are as well but after that all other sums are incorrect </p>
