Declare create and initialize a threedimensional array of in

Declare, create, and initialize a three-dimensional array of ints, x, that has 3 rows, each of which has 2 columns where each column is an array 4 ints. The elements in the first row are all 5, in the second row are all 7, and in the third row the first column is all 8 and the second column is 30, 31, 32, and 33.

Solution

Here is the 3- Dimensional array declaration, creation and intializing:

int[][][] x = {{{5,5,5,5},{5,5,5,5}},

           {{7,7,7,7},{7,7,7,7}},

           {{8,8,8,8},{30,31,32,33}}};

Declare, create, and initialize a three-dimensional array of ints, x, that has 3 rows, each of which has 2 columns where each column is an array 4 ints. The ele

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site