Professional Documents
Culture Documents
Arrays
An array is collection of values, with every value is accessed
by an index, i.e.,
String cityname[4][12];
// makes an array of 48(4x12) strings
Rectangular data
A two
dimensional
array is an array
of arrays, i.e.,
every row or
column is itself
an array.
Generally
processed with
nested loops.
Rectangular data
const int ROWS=3, COLS=2;
double rda[ROWS][COLS];
cout << "Enter six values for 3X2 matrix" << endl;
for(int r=0; r<ROWS; r++)
for(int c=0; c<COLS; c++)
cin >> rda[r][c];
Generalize it
What about triangular data