As the total is one value then you don't need an array to print it (although if you want to store the subtotals then you could use a one-dimensional array) -
Code:
#include<iostream>
#include <cstdlib>
#include <cstdio>
#include <ctime>
using namespace std;
#define ROW 5
#define COLUMN 4
int main()
{
int sales[ROW][COLUMN]={0};
int sumtotal=0,sum=0;
int down;
int across;
srand((unsigned)time(NULL));
cout.setf(ios::right);
cout<<endl;
//print the table
for (down=0;down<ROW;down++)
{
for (across=0;across<COLUMN;across++)
{
sum += sales[down][across]=rand()%21;
cout.width(4);
cout<<sales[down][across];
}
cout<<" |"<<sum << endl;
sum=0;
}
cout<<"-----------------|------"<<endl;
sum =0;
//sums of the columns
for (across=0;across<COLUMN;across++)
{
for (down=0;down<ROW;down++)
{
sum+=sales[down][across];
}
cout.width(4);
sumtotal+=sum;
cout<<sum;
sum=0;
}
cout<<" |"<<sumtotal<<endl ;
return 0;
}