Easy learning with example program codes

CPP Multidimensional Arrays

A multidimensional array is an array containing two, three, four, five, or more arrays. The increasing number of dimensions, increases the code complexity for the developers. The most popular arrays are single, two and three dimensional arrays.

Two dimensional Arrays:

A two-dimensional array can be defined as an array of arrays that needs two indices for every element.

Three dimensional Arrays:

A three-dimensional array can be defined as an array of arrays of arrays that needs three indices for every element.

Example: Accessing the elements of a two dimensional array.

#include <iostream.h>
using namespace std;
int main()
int a[2][2] =  
	{  {2, 5}, {4, 0}  };
int b[2][2] =  
	{  {4, 5},  {4, 8}  };
int c[2][2] =  
	{  {0, 0},  {0, 0}  };
int i,j;    
c[i][j] = 0;
c[i][j] = a[i][j] + b[i][j];
cout << c[i][j]<<endl;
return 0;


Posted in CPP   

Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at


We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on

Copyright © 2019 CodesJava Protection Status SiteMap Reference: Java Wiki