Use this code
#include <iostream>
using namespace std;
//QTMultiArray1.prj main.cpp
void multiarray()
{
cout << "6 x6 multidimensional array!QTMultiArray1.prj" << endl;
// Declare a 10x10 array
const int nRows = 6;
const int nColumns = 6;
int nArrayTable[nRows ][nColumns ] = { 0 };
// Calculate a multiplication table
for (int row = 0; row < nRows; row++)
{
for (int col = 0; col < nColumns; col++)
{
nArrayTable[row][col] = row * col;
if(col != 0 && row != 0)
cout << nArrayTable[row][col] << "\t";
}
if(row != 0)
cout << endl;
}
}
int main()
{
multiarray();
cout << "Good Bye!" << endl;
return 0;
}
|