909 views
0 0 votes

 

In a lower triangular matrices (size 15 × 15) representation of compact single dimensional array, non-zero elements (i.e. elements of the lower triangle) of each row are stored one after another, starting from the first row. Assume each integer take 1B. The array stored in row major order and first element of array is stored at location 1000, then the address of element A[10][6]

1 Answer

0 0 votes

lower triangular matrix [15][15] have first row 1 element, 2nd row 2 element, 3rd row 3 element......15th row 15 element.

Now for [10][6], we need to cross 9 row and when we reach in 10th row we have to cross 5 element. than we will reach beginning of [10][6].

then number of element passed are (1+2+3...+9)+5=50

then the address= 1000+50=1050

Note: array's first element should have the address 1000. mean either [1][1] or [0][0] you are assuming as array's first element should have the address 1000. on the basis of that you will get only 1050 as answer address for [10][6] what ever you assume earlier

Position:
Show:

Related questions

1 1 vote
1 1 answer
252
252 views
Titiksha_Gupta asked Jan 5
252 views
4 4 votes
2 answers 2 answers
473
473 views
harishdewangan asked Aug 9, 2025
473 views
Consider following two functions in c: int f1(int n) int f2(int n){ ...
0 0 votes
1 1 answer
491
491 views
gaurav_sah asked Apr 23, 2025
491 views
faster access to non local variables is achived using an array pointers to activation records called a stack , heap , display , activation tree?
3 3 votes
1 answers 1 answer
1.1k
1.1k views
saket jaiswal asked Jan 22, 2025
1,130 views
#include <stdio.h int main() { int x = 10, y = 5, z = 2; int result = x y ? y z ? 1 : z x ? 2 : 3 : y z ? 4 : z x ? 5 : 6; printf("%d", result); retu...