X
ONLINE BOOKING
BOOK NOW
OFFLINE BOOKING
Call or WhatsApp 7993732682 (WhatsApp Now), 9177341827 (WhatsApp Now)
X
• Home
• Legal Disclaimer
• Terms & Conditions
• Return Policy
• Need any help?? write to us at

support@engineershub.in

X
Login to access posts, links, updates, question papers, materials, one liners!
Go Back
Go Back
Go Back
OR
Fill Up a Simple Form
Fill all the below details correctly and click on Next
Go Back
Explain how two-dimensional arrays can be used to represent matrices? (OR) Define an array and how the memory is allocated for a 2D array? - EngineersHub
Go Back Question
Arunbavu Arun
1 year ago
1 Answer(s) posted Write an answer 3468 Answer posted by Ruchitha
1 year ago

These are stored in the memory as given below.

1) Row-Major order Implementation

2) Column-Major order Implementation

In Row-Major Implementation of the arrays, the arrays are stored in the memory in terms of the row design, i.e. first the first row of the array is stored in the memory then second, and so on.

Suppose we have an array named arr having 3 rows and 3 columns then it can be stored in the memory in the following manner :

int arr; Thus an array of 3*3 can be declared as follows :

arr = { 1, 2, 3,

4, 5, 6,

7, 8, 9 };

and it will be represented in the memory with row-major implementation as follows : In Column-Major Implementation of the arrays, the arrays are stored in the memory in the term of the column design, i.e. the first column of the array is stored in the memory than the second, and so on. By taking the above eg. we can show it as follows :

arr = { 1, 2, 3,

4, 5, 6,

7, 8, 9 };

and it will be represented in the memory with column-major implementation as follows : Two-dimensional arrays of variable length

An array consisting of two subscripts is known as a two-dimensional array. These are often known as an array of the array. In two-dimensional arrays, the array is divided into rows and columns,.

These are well suited to handle the table of data. In a 2-D array, we can declare an array as :

Declaration:-

Syntax: data_type array_name[row_size][column_size];

Ex: int arr ;

Where first index value shows the number of the rows and the second index value shows the no. of the columns in the array.

These are stored in the memory as given below. Initialization:-

To initialize values for variable-length arrays we can use scanf statement and loop constructs.

Ex:-

for ( i=0 ; i<3; i++ )

for( j=0;j<3;j++ )

scanf( “ %d ”,&arr[i][j] );

### Users Joined Nani
4 days ago Mortal
5 days ago soumya kothapalli
5 days ago RAVI
5 days ago onigiri
6 days ago
X
Explain how two-dimensional arrays can be used to represent matrices? (OR) Define an array and how the memory is allocated for a 2D array?
X
Explain how two-dimensional arrays can be used to represent matrices? (OR) Define an array and how the memory is allocated for a 2D array?

These are stored in the memory as given below.

1) Row-Major order Implementation

2) Column-Major order Implementation

In Row-Major Implementation of the arrays, the arrays are stored in the memory in terms of the row design, i.e. first the first row of the array is stored in the memory then second, and so on.

Suppose we have an array named arr having 3 rows and 3 columns then it can be stored in the memory in the following manner :

int arr; Thus an array of 3*3 can be declared as follows :

arr = { 1, 2, 3,

4, 5, 6,

7, 8, 9 };

and it will be represented in the memory with row-major implementation as follows : In Column-Major Implementation of the arrays, the arrays are stored in the memory in the term of the column design, i.e. the first column of the array is stored in the memory than the second, and so on. By taking the above eg. we can show it as follows :

arr = { 1, 2, 3,

4, 5, 6,

7, 8, 9 };

and it will be represented in the memory with column-major implementation as follows : Two-dimensional arrays of variable length

An array consisting of two subscripts is known as a two-dimensional array. These are often known as an array of the array. In two-dimensional arrays, the array is divided into rows and columns,.

These are well suited to handle the table of data. In a 2-D array, we can declare an array as :

Declaration:-

Syntax: data_type array_name[row_size][column_size];

Ex: int arr ;

Where first index value shows the number of the rows and the second index value shows the no. of the columns in the array.

These are stored in the memory as given below. Initialization:-

To initialize values for variable-length arrays we can use scanf statement and loop constructs.

Ex:-

for ( i=0 ; i<3; i++ )

for( j=0;j<3;j++ )

scanf( “ %d ”,&arr[i][j] );  x