Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Let A be a two-dimensional array declared as ... Start Learning for Free
Let A be a two-dimensional array declared as follows:
A : array [1 ... 10] [1... 15] of integer;
Assuming that each integer takes one memory location. The array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element A [i] [j] ?
  • a)
    15i + j + 84
  • b)
    15j + i + 84
  • c)
    10i + j + 89
  • d)
    10j + i + 89
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
Let A be a two-dimensional array declared as follows:A : array [1 ... ...
Let r be number of elements in a row. Address of the element A[i] [j]
View all questions of this test
Most Upvoted Answer
Let A be a two-dimensional array declared as follows:A : array [1 ... ...
Address of the element A[i][j]

To find the address of the element A[i][j], we need to consider that the array is stored in row-major order and the first element of the array is stored at location 100.

Row-Major Order

In row-major order, the elements of the array are stored consecutively in memory row by row. This means that the elements of each row are stored one after another in memory.

Calculating the address

Let's break down the given array declaration: A : array [1 ... 10] [1 ... 15] of integer.

The array has 10 rows (from index 1 to 10) and 15 columns (from index 1 to 15).

The size of each integer element is 1 memory location.

The first element of the array is stored at location 100.

To calculate the address of the element A[i][j], we can use the formula:

Address = Base Address + (Row Size * (i - 1)) + (Column Size * (j - 1))

In this case, the base address is 100, the row size is 15, and the column size is 1.

So, the address of the element A[i][j] can be calculated as:

Address = 100 + (15 * (i - 1)) + (1 * (j - 1))

Simplifying further:

Address = 100 + 15i - 15 + j - 1

Address = 15i + j - 16 + 100

Address = 15i + j + 84

Therefore, the correct answer is option 'A': 15i + j + 84.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Let A be a two-dimensional array declared as follows:A : array [1 ... 10] [1... 15] of integer;Assuming that each integer takes one memory location. The array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element A [i] [j] ?a)15i+ j+ 84b)15j + i + 84c)10i+ j+ 89d)10j+ i+ 89Correct answer is option 'A'. Can you explain this answer?
Question Description
Let A be a two-dimensional array declared as follows:A : array [1 ... 10] [1... 15] of integer;Assuming that each integer takes one memory location. The array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element A [i] [j] ?a)15i+ j+ 84b)15j + i + 84c)10i+ j+ 89d)10j+ i+ 89Correct answer is option 'A'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Let A be a two-dimensional array declared as follows:A : array [1 ... 10] [1... 15] of integer;Assuming that each integer takes one memory location. The array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element A [i] [j] ?a)15i+ j+ 84b)15j + i + 84c)10i+ j+ 89d)10j+ i+ 89Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Let A be a two-dimensional array declared as follows:A : array [1 ... 10] [1... 15] of integer;Assuming that each integer takes one memory location. The array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element A [i] [j] ?a)15i+ j+ 84b)15j + i + 84c)10i+ j+ 89d)10j+ i+ 89Correct answer is option 'A'. Can you explain this answer?.
Solutions for Let A be a two-dimensional array declared as follows:A : array [1 ... 10] [1... 15] of integer;Assuming that each integer takes one memory location. The array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element A [i] [j] ?a)15i+ j+ 84b)15j + i + 84c)10i+ j+ 89d)10j+ i+ 89Correct answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Let A be a two-dimensional array declared as follows:A : array [1 ... 10] [1... 15] of integer;Assuming that each integer takes one memory location. The array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element A [i] [j] ?a)15i+ j+ 84b)15j + i + 84c)10i+ j+ 89d)10j+ i+ 89Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Let A be a two-dimensional array declared as follows:A : array [1 ... 10] [1... 15] of integer;Assuming that each integer takes one memory location. The array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element A [i] [j] ?a)15i+ j+ 84b)15j + i + 84c)10i+ j+ 89d)10j+ i+ 89Correct answer is option 'A'. Can you explain this answer?, a detailed solution for Let A be a two-dimensional array declared as follows:A : array [1 ... 10] [1... 15] of integer;Assuming that each integer takes one memory location. The array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element A [i] [j] ?a)15i+ j+ 84b)15j + i + 84c)10i+ j+ 89d)10j+ i+ 89Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of Let A be a two-dimensional array declared as follows:A : array [1 ... 10] [1... 15] of integer;Assuming that each integer takes one memory location. The array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element A [i] [j] ?a)15i+ j+ 84b)15j + i + 84c)10i+ j+ 89d)10j+ i+ 89Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Let A be a two-dimensional array declared as follows:A : array [1 ... 10] [1... 15] of integer;Assuming that each integer takes one memory location. The array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element A [i] [j] ?a)15i+ j+ 84b)15j + i + 84c)10i+ j+ 89d)10j+ i+ 89Correct answer is option 'A'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev