Two-Dimensional Array addition problem
<p>The problem was asking for employee numbers 1 through 10 (they gave me the array numbers to enter into the array) give the total sales for each employee by combining the 3 months together. In my addition function it does everything correctly....for the first part... It displays the numbers in the array perfectly but then when it goes to add the arrays and tosses out an element here and there resulting in incorrect totals. In my code I added that it should cout the array numbers that it is adding together after the first set of numbers it doesn't follow the array here is the code:</p>

<p>I followed what you guys were showing me (thank you btw) and I am now adding Employee #1's total to the rest which I do not want to do. I want to enter Employee #1's to each other stop display it then add Employee #2's total from the 3 numbers in the 3 months array stop display (continue until each piece is displayed 1~10) I have entered my new code for revision. I am new to C++ programming and I have not learned about classes yet so I honestly cannot use them.</p>

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

using namespace std;

void displaySales(int sales[10][3]);
void displayTotalSales(int total[10][3]);

int main () 
   {

    //declare array       Jan    Feb   Mar
    int employ[10][3] = {{2400, 3500, 2000},
                         {1500, 7000, 1000},
                         {600,   450, 2100},
                         {790,   240,  500},
                         {1000, 1000, 1000},
                         {6300, 7000, 8000},
                         {1300,  450,  700},
                         {2700, 5500, 6000},
                         {4700, 4800, 4900},
                         {1200, 1300,  400}};
    //displays the sales for the month
    displaySales(employ);
    displayTotalSales(employ);
    system("pause");
    return 0;
   }

//******Functions*******

void displaySales(int sales[10][3])
{


    for(int emp = 0; emp &lt; 10; emp++)
    {
        cout &lt;&lt; "Employee # " &lt;&lt; emp + 1
             &lt;&lt; ": " &lt;&lt; endl;
        for (int month = 0; month &lt; 3; month++)
        {

            cout &lt;&lt; " Month " &lt;&lt; month + 1
                 &lt;&lt; ": ";
            cout &lt;&lt; sales[emp][month] &lt;&lt; endl;

        } //end for
    } //end for
} //end function

void displayTotalSales(int total[10][3])
{
    int employ = 1; //employee number 
    int totalSales = 0; // total sales for the employee


        for (int i = 0; i &lt; 10; i++)
        {
            for (int j = 0; j &lt; 3; j++)
            {
                totalSales += total[i][j];
            cout &lt;&lt; "Employee # " &lt;&lt; employ &lt;&lt; ": " &lt;&lt; endl;
            cout &lt;&lt; endl;
            cout &lt;&lt; "Total sales for the month: " &lt;&lt; "$" &lt;&lt; total[i][j];
            cout &lt;&lt; endl;
            }
            cout &lt;&lt; " Total Sales for the three months is: $" &lt;&lt; totalSales &lt;&lt; endl;
            cout &lt;&lt; endl;
            employ++;
        }
}
</code></pre>
