593 views
5 votes
5 votes

Q. A p×p array ‘M’ is defined as follows:-

M[a, b] = a – b for all a,b, 1 ≤ a, b ≤ p.      

The sum of elements of the array M is

(a) p – 1                                                                       (b) p2 – 3p + 2

(c) 0                                                                             (d) p2(p+1)/ 2

2 Answers

Best answer
9 votes
9 votes

To solve these type of question,,,take one example

let take 3×3 array

so M[1,1] =0

 M[1,2] =-1

M[1,3] =-2

M[2,1] =1

M[2,2] =0

M[2,3] =-1

M[3,1] =2

M[3,2] =1

M[3,3] =0

here we get sum of elements of the array M =0

and check option (put p=3)

so (c) is correct

selected by
1 votes
1 votes
The answer for the above questions is C

take any simple matrix

and form the matrix with the help of given condition

and sum them all

you will get 0

Related questions

1 votes
1 votes
1 answer
1
Mrityudoot asked Feb 2
282 views
In what cases does an uninitialized array have values = 0 and for which cases does it have values = garbage values. How to differentiate?
1 votes
1 votes
1 answer
2
Mrityudoot asked Feb 2
164 views
Does C support fractional Indices?float x = some fraction;Is float a[x] valid declaration?
1 votes
1 votes
1 answer
3
amitarp818 asked Oct 25, 2023
422 views
How is the address written for 3-dimensional arrays?In some answers, I saw (row, column, frame) and in others, it was (frame, row, column) Which one to follow??Also, how ...
0 votes
0 votes
1 answer
4
viral8702 asked Apr 29, 2022
483 views
A frame buffer array is addressed in row major order for a monitor with pixel locations starting from (0,0) and ending with (100,100). What is address of the pixel(6,10)?...