Two Dimensional Aray

Two Dimensionalal Array ?

A list of items group in a single variable name wit two indexes(row and column size) is called 2-D array.
datatype array_name[][]=new datatype[size1][size2];
size1 - number of rows
size2- number of columns.


A two-dimensional array is an array in which each element is itself a 1-D array.

The simplest form of the multidimensional array is the two-dimensional array. A two-dimensional array is, in essence, a list of one-dimensional arrays. To declare a two-dimensional integer array of size x,y,
Syntax:
data_type array_name[row_size][column_size];


Example 1:



Output:

test[0][0] = 2
test[0][1] = -5
test[1][0] = 4
test[1][1] = 0
test[2][0] = 9
test[2][1] = 1