| 15 | } |
| 16 | |
| 17 | void salesman_sum(int a[3][5]) |
| 18 | { |
| 19 | int row, col, sum = 0; |
| 20 | // finding the column sum |
| 21 | for (row = 0; row < 5; ++row) |
| 22 | { |
| 23 | for (col = 0; col < 3; ++col) |
| 24 | { |
| 25 | |
| 26 | // Add the element |
| 27 | sum = sum + a[col][row]; |
| 28 | } |
| 29 | // Print the column sum |
| 30 | cout << "The Total sales of Salesman " << row + 1 << " is " << sum << endl; |
| 31 | // Reset the sum |
| 32 | sum = 0; |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | void sales_sum(int a[3][5]) |
| 37 | { |