#include <cstdlib>
#include <iostream>
usingnamespace std;
int main(int argc, char *argv[])
{
constint numRows = 5; // set the size of rows of our multi Array
constint numCols = 5; // set the size of column of our multi Array
int ctrRows; // counter for our row loops
int ctrCols; // counter for our column loops
int multiArray[numRows][numCols] = {0}; // declaration of Multidimensional Arrays
int num = 1; // the value that we need to store in our array
for(ctrRows = 0; ctrRows < 5; ctrRows++) // first loop..intended for the rows of the array
{
for(ctrCols = 0; ctrCols < 5; ctrCols++) // first loop..intended for the column of the array
{
multiArray[ctrRows][ctrCols] = num; // assigning a value
num++;
}
num = num - 4;
}
for(ctrRows = 0; ctrRows < 5; ctrRows++) // first loop..intended for the rows of the array
{
for(ctrCols = 0; ctrCols < 5; ctrCols++) // first loop..intended for the column of the array
{
cout << multiArray[ctrRows][ctrCols] << " "; //output the value
}
cout << endl;
}
system("pause");
return 0;
}
Wow!!! that's a great idea.. however I am still studying the very basics of C++. I will try to make a code on what you just suggested.... Thanks a lot :)